Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebe-lew committed Jan 8, 2024
1 parent 1c32b43 commit 0291a69
Show file tree
Hide file tree
Showing 11 changed files with 138 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
_site
.idea
1 change: 1 addition & 0 deletions bin/.go-1.21.5.pkg
7 changes: 7 additions & 0 deletions bin/README.hermit.md
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.
21 changes: 21 additions & 0 deletions bin/activate-hermit
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
1 change: 1 addition & 0 deletions bin/go
1 change: 1 addition & 0 deletions bin/gofmt
43 changes: 43 additions & 0 deletions bin/hermit
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" -- "$@"
Empty file added bin/hermit.hcl
Empty file.
2 changes: 1 addition & 1 deletion reports/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/TBD54566975/sdk-development/reports

go 1.20
go 1.21

require (
github.com/bradleyfalzon/ghinstallation/v2 v2.8.0
Expand Down
47 changes: 46 additions & 1 deletion reports/report-template.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>web5 spec compliance report</title>
<title>TBD SDKs spec compliance report</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="styles.css" />
Expand Down Expand Up @@ -53,6 +53,51 @@ <h2 id="{{ $category }}_table-caption">{{ $category }}</h2>
{{ end }}
</table>
{{ end }}

<h1>tbdex spec compliance report</h1>

{{ range $category, $tests := .Tests }}
<h2 id="{{ $category }}_table-caption">{{ $category }}</h2>
<table aria-labelledby="{{ $category }}_table-caption">
<colgroup>
<col span="1" />
<col span="2" />
</colgroup>
<thead>
<tr>
<th scope="col">test vector</th>
{{ range $.Reports }}
<th scope="col">
<a target="_blank" href="https://github.com/{{ .SDK.Repo }}"
>{{ .SDK.Name }}</a
>
</th>
{{ end }}
</tr>
</thead>
<tbody>
{{ range $i, $test := $tests }}
<tr>
<th scope="row">{{ $test }}</th>
{{ range $_, $report := $.Reports }}
<td>
<details{{ if eq (len (index (index .Results $category) $test).Errors) 0 }} tabindex="-1"{{ end }}>
<summary{{ if eq (len (index (index .Results $category) $test).Errors) 0 }} role="paragraph"{{ end }}>
<span aria-label="{{ (index (index .Results $category) $test).GetEmojiAriaLabel }}">{{ (index (index .Results $category) $test).GetEmoji }}</span>
</summary>
<ul>
{{ range (index (index .Results $category) $test).Errors }}
<li>{{ . }}</li>
{{ end }}
</ul>
</details>
</td>
{{ end }}
</tr>
</tbody>
{{ end }}
</table>
{{ end }}
</main>
</body>
</html>
16 changes: 16 additions & 0 deletions reports/sdks.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ var (
VectorRegex: regexp.MustCompile(`(\w+)\(\)`),
VectorPath: "test-vectors",
},
{
Name: "tbdex-js",
Repo: "TBD54566975/tbdex-js",
ArtifactName: "junit-results",
FeatureRegex: regexp.MustCompile(`TbdexTestVectors(\w+)`),
VectorRegex: regexp.MustCompile(`\w+ \w+ (\w+)`),
VectorPath: "test-vectors",
},
{
Name: "tbdex-kt",
Repo: "TBD54566975/tbdex-kt",
ArtifactName: "test-results",
FeatureRegex: regexp.MustCompile(`web5\.sdk\.\w+.TbdexTestVectors(\w+)`),
VectorRegex: regexp.MustCompile(`(\w+)\(\)`),
VectorPath: "test-vectors",
},
}
)

Expand Down

0 comments on commit 0291a69

Please sign in to comment.