-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorporate tbdex vector results into report #99
Changes from all commits
0291a69
e4d8b37
684c7cb
1972713
3592be1
50c0444
f820ac7
a7a742f
14af746
e0a1e2b
ab1e08b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
_site | ||
.idea |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hermit |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Hermit environment | ||
|
||
This is a [Hermit](https://github.com/cashapp/hermit) bin directory. | ||
|
||
The symlinks in this directory are managed by Hermit and will automatically | ||
download and install Hermit itself as well as packages. These packages are | ||
local to this environment. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# This file must be used with "source bin/activate-hermit" from bash or zsh. | ||
# You cannot run it directly | ||
# | ||
# THIS FILE IS GENERATED; DO NOT MODIFY | ||
|
||
if [ "${BASH_SOURCE-}" = "$0" ]; then | ||
echo "You must source this script: \$ source $0" >&2 | ||
exit 33 | ||
fi | ||
|
||
BIN_DIR="$(dirname "${BASH_SOURCE[0]:-${(%):-%x}}")" | ||
if "${BIN_DIR}/hermit" noop > /dev/null; then | ||
eval "$("${BIN_DIR}/hermit" activate "${BIN_DIR}/..")" | ||
|
||
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ]; then | ||
hash -r 2>/dev/null | ||
fi | ||
|
||
echo "Hermit environment $("${HERMIT_ENV}"/bin/hermit env HERMIT_ENV) activated" | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.go-1.21.5.pkg | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.go-1.21.5.pkg |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
# | ||
# THIS FILE IS GENERATED; DO NOT MODIFY | ||
|
||
set -eo pipefail | ||
|
||
export HERMIT_USER_HOME=~ | ||
|
||
if [ -z "${HERMIT_STATE_DIR}" ]; then | ||
case "$(uname -s)" in | ||
Darwin) | ||
export HERMIT_STATE_DIR="${HERMIT_USER_HOME}/Library/Caches/hermit" | ||
;; | ||
Linux) | ||
export HERMIT_STATE_DIR="${XDG_CACHE_HOME:-${HERMIT_USER_HOME}/.cache}/hermit" | ||
;; | ||
esac | ||
fi | ||
|
||
export HERMIT_DIST_URL="${HERMIT_DIST_URL:-https://github.com/cashapp/hermit/releases/download/stable}" | ||
HERMIT_CHANNEL="$(basename "${HERMIT_DIST_URL}")" | ||
export HERMIT_CHANNEL | ||
export HERMIT_EXE=${HERMIT_EXE:-${HERMIT_STATE_DIR}/pkg/hermit@${HERMIT_CHANNEL}/hermit} | ||
|
||
if [ ! -x "${HERMIT_EXE}" ]; then | ||
echo "Bootstrapping ${HERMIT_EXE} from ${HERMIT_DIST_URL}" 1>&2 | ||
INSTALL_SCRIPT="$(mktemp)" | ||
# This value must match that of the install script | ||
INSTALL_SCRIPT_SHA256="180e997dd837f839a3072a5e2f558619b6d12555cd5452d3ab19d87720704e38" | ||
if [ "${INSTALL_SCRIPT_SHA256}" = "BYPASS" ]; then | ||
curl -fsSL "${HERMIT_DIST_URL}/install.sh" -o "${INSTALL_SCRIPT}" | ||
else | ||
# Install script is versioned by its sha256sum value | ||
curl -fsSL "${HERMIT_DIST_URL}/install-${INSTALL_SCRIPT_SHA256}.sh" -o "${INSTALL_SCRIPT}" | ||
# Verify install script's sha256sum | ||
openssl dgst -sha256 "${INSTALL_SCRIPT}" | \ | ||
awk -v EXPECTED="$INSTALL_SCRIPT_SHA256" \ | ||
'$2!=EXPECTED {print "Install script sha256 " $2 " does not match " EXPECTED; exit 1}' | ||
fi | ||
/bin/bash "${INSTALL_SCRIPT}" 1>&2 | ||
fi | ||
|
||
exec "${HERMIT_EXE}" --level=fatal exec "$0" -- "$@" |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -17,34 +17,51 @@ func sanatizeHTML(dirty error) string { | |||||
} | ||||||
|
||||||
type htmlTemplateInput struct { | ||||||
Reports []Report | ||||||
Tests map[string][]string | ||||||
Reports []Report | ||||||
Web5Tests map[string][]string | ||||||
TbDEXTests map[string][]string | ||||||
} | ||||||
|
||||||
func WriteHTML(reports []Report, filename string) error { | ||||||
slog.Info("writing html report", "reports", len(reports)) | ||||||
|
||||||
testmap := make(map[string]map[string]bool) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
for consistency |
||||||
tbdexTestMap := make(map[string]map[string]bool) | ||||||
for _, report := range reports { | ||||||
for category, tests := range report.Results { | ||||||
if _, ok := tests[category]; !ok { | ||||||
testmap[category] = map[string]bool{} | ||||||
if report.SDK.Type == "web5" { | ||||||
testmap[category] = map[string]bool{} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: could we rename this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you shouldn't need to initialize like this..., but if it breaks pls use |
||||||
} else { | ||||||
tbdexTestMap[category] = map[string]bool{} | ||||||
} | ||||||
} | ||||||
|
||||||
for test := range tests { | ||||||
testmap[category][test] = true | ||||||
if report.SDK.Type == "web5" { | ||||||
testmap[category][test] = true | ||||||
} else { | ||||||
tbdexTestMap[category][test] = true | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
templateInput := htmlTemplateInput{ | ||||||
Reports: reports, | ||||||
Tests: make(map[string][]string), | ||||||
Reports: reports, | ||||||
Web5Tests: make(map[string][]string), | ||||||
TbDEXTests: make(map[string][]string), | ||||||
} | ||||||
|
||||||
for category, tests := range testmap { | ||||||
for test := range tests { | ||||||
templateInput.Tests[category] = append(templateInput.Tests[category], test) | ||||||
templateInput.Web5Tests[category] = append(templateInput.Web5Tests[category], test) | ||||||
} | ||||||
} | ||||||
|
||||||
for category, tests := range tbdexTestMap { | ||||||
for test := range tests { | ||||||
templateInput.TbDEXTests[category] = append(templateInput.TbDEXTests[category], test) | ||||||
} | ||||||
} | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ var ( | |
FeatureRegex: regexp.MustCompile(`Web5TestVectors(\w+)`), | ||
VectorRegex: regexp.MustCompile(`.* Web5TestVectors\w+ (\w+)`), | ||
VectorPath: "test-vectors", | ||
Type: "web5", | ||
}, | ||
{ | ||
Name: "web5-kt", | ||
|
@@ -28,6 +29,25 @@ var ( | |
FeatureRegex: regexp.MustCompile(`web5\.sdk\.\w+.Web5TestVectors(\w+)`), | ||
VectorRegex: regexp.MustCompile(`(\w+)\(\)`), | ||
VectorPath: "test-vectors", | ||
Type: "web5", | ||
}, | ||
{ | ||
Name: "tbdex-js", | ||
Repo: "TBD54566975/tbdex-js", | ||
ArtifactName: "junit-results", | ||
FeatureRegex: regexp.MustCompile(`TbdexTestVectors(\w+)`), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so you have been naming your tests: for example: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yep, Think I have a copy paste error for the vector regex though! |
||
VectorRegex: regexp.MustCompile(`.* TbdexTestVectors\w+ (\w+)`), | ||
VectorPath: "test-vectors", | ||
Type: "tbdex", | ||
}, | ||
{ | ||
Name: "tbdex-kt", | ||
Repo: "TBD54566975/tbdex-kt", | ||
ArtifactName: "test-results", | ||
FeatureRegex: regexp.MustCompile(`tbdex\.sdk\.\w+.TbdexTestVectors(\w+)`), | ||
VectorRegex: regexp.MustCompile(`(\w+)\(\)`), | ||
VectorPath: "test-vectors", | ||
Type: "tbdex", | ||
}, | ||
} | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be 1.21.6 now?