diff --git a/munge_aggregates.js b/munge_aggregates.js
index 26cbc52f4..117a1000b 100644
--- a/munge_aggregates.js
+++ b/munge_aggregates.js
@@ -107,7 +107,7 @@ const main = async () => {
for (const row of testsRows) {
const { versions, full_name, name, parent_test_full_name } = row;
- const slug = slugify(full_name);
+ const slug = slugifyTestName(full_name);
if (!groups[parent_test_full_name]) {
groups[parent_test_full_name] = {};
@@ -285,7 +285,7 @@ const main = async () => {
const testResults = {};
for (const row of rows) {
- testResults[row.full_name] = { ...row, slug: slugify(row.full_name) };
+ testResults[row.full_name] = { ...row, slug: slugifyTestName(row.full_name) };
}
outputJSON(`data/testresults/${id}/${version}.json`, testResults);
}
@@ -310,8 +310,9 @@ const main = async () => {
const testsTaxonomy = {};
for (const row of testsTaxonomyRows) {
- const { full_name, name, test_run_implementation_id, test_run_version } = row;
- const slug = slugify(full_name);
+ const { full_name, test_run_implementation_id, test_run_version } = row;
+ const slug = slugifyTestName(full_name);
+ const name = decodeURIComponent(row.name);
if (!testsTaxonomy[full_name]) {
testsTaxonomy[full_name] = {
@@ -349,6 +350,7 @@ const main = async () => {
test_run_implementation_id AS implementation_id,
test_run_version AS version,
full_name,
+ name,
outcome
FROM TestResult
ORDER BY test_run_implementation_id, test_run_version, full_name
@@ -358,7 +360,8 @@ const main = async () => {
const resultsTaxonomy = {};
for (const row of resultsTaxonomyRows) {
const { implementation_id, version, full_name, outcome } = row;
- const slug = slugify(full_name);
+ const slug = slugifyTestName(full_name);
+ const name = decodeURIComponent(row.name);
if (!resultsTaxonomy[implementation_id]) {
resultsTaxonomy[implementation_id] = {};
@@ -371,6 +374,7 @@ const main = async () => {
if (!resultsTaxonomy[implementation_id][version][full_name]) {
resultsTaxonomy[implementation_id][version][full_name] = {
slug,
+ name,
full_name,
outcome,
};
@@ -395,7 +399,7 @@ const main = async () => {
...test,
implementation_id,
version,
- title: test.full_name
+ title: test.name
});
}
}
@@ -418,12 +422,23 @@ const slugify = (str) => {
.trim() // trim leading or trailing whitespace
.toLowerCase() // convert to lowercase
.replace(/\s+/g, '_') // replace spaces with underscore
+ .replace(/[.,()"/]/g, '-') // remove the characters (, ) and ~
+ .replace(/[^a-z0-9 -\/]/g, '-') // remove non-alphanumeric characters
.replace(/_+/g, '_') // remove consecutive underscores
- .replace(/[\/]/g, "__")
- .replace(/[^a-z0-9 -]/g, '-') // remove non-alphanumeric characters
.replace(/-+/g, '-') // remove consecutive dashes
}
+const slugifyTestName = (str) => {
+ let x = String(str).split('/');
+ x = x.map(part => {
+ // url decode to handle %20, etc
+ part = decodeURIComponent(part);
+ return slugify(part.replace(/([a-z])([A-Z])/g, '$1-$2') // Convert CamelCase to kebab-case
+ )
+ })
+ return x.join('/');
+}
+
const outputJSON = (p, data) => {
const json = JSON.stringify(data, null, 2);
const fullPath = `${hugoOutput}/${p}`;
diff --git a/tooling/test/test.go b/tooling/test/test.go
index f9a470843..787f1a2eb 100644
--- a/tooling/test/test.go
+++ b/tooling/test/test.go
@@ -3,6 +3,8 @@ package test
import (
"context"
"net/http"
+ "net/url"
+ "strings"
"testing"
"time"
@@ -68,8 +70,10 @@ func run(t *testing.T, tests SugarTests) {
timeout, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()
+ name := safeName(test.Name)
+
if len(test.Requests) > 0 {
- t.Run(test.Name, func(t *testing.T) {
+ t.Run(name, func(t *testing.T) {
tooling.LogSpecs(t, test.AllSpecs()...)
responses := make([]*http.Response, 0, len(test.Requests))
@@ -82,7 +86,7 @@ func run(t *testing.T, tests SugarTests) {
validateResponses(t, test.Responses, responses)
})
} else {
- t.Run(test.Name, func(t *testing.T) {
+ t.Run(name, func(t *testing.T) {
tooling.LogSpecs(t, test.AllSpecs()...)
_, res, localReport := runRequest(timeout, t, test, test.Request)
validateResponse(t, test.Response, res, localReport)
@@ -90,3 +94,16 @@ func run(t *testing.T, tests SugarTests) {
}
}
}
+
+func safeName(s string) string {
+ // Split the string by spaces
+ parts := strings.Split(s, " ")
+
+ // Escape each part
+ for i, part := range parts {
+ parts[i] = url.PathEscape(part)
+ }
+
+ // Join the parts back together with spaces
+ return strings.Join(parts, " ")
+}
diff --git a/www/content/results/_index.md b/www/content/results/_index.md
new file mode 100644
index 000000000..3b7340f91
--- /dev/null
+++ b/www/content/results/_index.md
@@ -0,0 +1,4 @@
+---
+title: Tests
+redirectsTo: /current
+---
diff --git a/www/content/tests/_index.md b/www/content/tests/_index.md
new file mode 100644
index 000000000..3b7340f91
--- /dev/null
+++ b/www/content/tests/_index.md
@@ -0,0 +1,4 @@
+---
+title: Tests
+redirectsTo: /current
+---
diff --git a/www/themes/conformance/layouts/partials/head.html b/www/themes/conformance/layouts/partials/head.html
index d56ffd290..666c1b3d6 100644
--- a/www/themes/conformance/layouts/partials/head.html
+++ b/www/themes/conformance/layouts/partials/head.html
@@ -1,2 +1,8 @@
{{ $styles := resources.Get "style.css" }}
+
+{{ with .Params.RedirectsTo }}
+
+{{ end }}
+
+{{ .Params.RedirectsTo }}
\ No newline at end of file