diff --git a/README.md b/README.md index 01bcc0c..0f641ca 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ doesn't support Alpine. | ----------------- | ------ | ---- | ------ | ------ | ------ | | bpftool | ✅ | ✅ | ✅ | ✅ | ✅ | | cni-plugins | | ✅ | ✅ | ✅ | ✅ | -| docsify | | ✅ | ✅ | ✅ | ✅ | +| docsify | | ? | ✅ | ? | ✅ | | go-ebpf | | ✅ | ✅ | ✅ | ✅ | | go-mod-upgrade | | ✅ | ✅ | ✅ | ✅ | | gocover | | ✅ | ✅ | ✅ | ✅ | diff --git a/TESTING.md b/TESTING.md new file mode 100644 index 0000000..d57c5ec --- /dev/null +++ b/TESTING.md @@ -0,0 +1,19 @@ +# Testing & Maintenance + +## Testing a DevContainer Feature + +To test a particular devcontainer feature, say, `lazygit`: + +```bash +devcontainer features test -f lazygit -i mcr.microsoft.com/devcontainers/base:ubuntu-24.04 . +``` + +- `--skip-scenarios` ... tests only the `test.sh` test case, but no scenario tests. +- `--filter alpine --skip-autogenerated` ... tests only the `alpine` scenario + (and neither `test.sh`). + +## Installing/Upgrading the DevContainer CLI + +```bash +npm install -g @devcontainers/cli@latest +``` diff --git a/src/gocover/devcontainer-feature.json b/src/gocover/devcontainer-feature.json index 09b1721..da5c808 100644 --- a/src/gocover/devcontainer-feature.json +++ b/src/gocover/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "Go Coverage with Badge", "id": "gocover", - "version": "0.1.2", + "version": "0.1.3", "description": "runs Go unit tests with coverages, updating the README.md with a coverage badge.", "options": { "root": { diff --git a/src/gocover/install.sh b/src/gocover/install.sh index aba0198..6ebf242 100755 --- a/src/gocover/install.sh +++ b/src/gocover/install.sh @@ -82,6 +82,7 @@ trap 'rm -rf -- "\${GOCOVERTMPDIR}"' EXIT [[ "\${ROOT}" = "true" ]] && ROOT="-exec=sudo" || unset ROOT [[ "\${RACE}" = "true" ]] && RACE="-race" || unset RACE [[ "\${VERBOSE}" = "true" ]] && VERBOSE="-v" || unset VERBOSE +[[ -n "\${TAGS}" ]] && TAGS="-tags=\${TAGS}" || unset TAGS [[ \${#POSARGS[@]} -eq 0 ]] && POSARGS+="./..." @@ -91,6 +92,7 @@ if [[ -n "\${ROOT+x}" ]]; then \${VERBOSE} \ \${RACE} \ -count=\${COUNT} \${NUM_PROGRAMS} \ + \${TAGS} \ \${COVERPKG} \ \${POSARGS[@]} -args -test.gocoverdir="\${GOCOVERTMPDIR}" fi @@ -98,6 +100,7 @@ go test -cover \ \${VERBOSE} \ \${RACE} \ -count=\${COUNT} \${NUM_PROGRAMS} \ + \${TAGS} \ \${COVERPKG} \ \${POSARGS[@]} -args -test.gocoverdir="\${GOCOVERTMPDIR}" diff --git a/test/docsify/port_5678.sh b/test/docsify/port_5678.sh index 2a83c17..c28591a 100755 --- a/test/docsify/port_5678.sh +++ b/test/docsify/port_5678.sh @@ -13,6 +13,6 @@ EOF check "serves at port 5678" bash -c "${CMD}" check "serves live-reload at port 5679" bash -c \ - "lsof -i :5679 -sTCP:LISTEN | awk 'NR>1 {print $1}' | grep -q 'node'" + "lsof -nP -iTCP:5679 -sTCP:LISTEN | awk 'NR>1 {print \$2}' | sort -u | (read PID && ps -p \$PID -o cmd= | grep -q 'node')" reportResults