|
45 | 45 |
|
46 | 46 | development: |
47 | 47 | name: "WASM Tests" |
48 | | - # TODO: figure out workaround for apparmor issue |
49 | | - # see #449 |
50 | | - runs-on: "ubuntu-22.04" |
| 48 | + runs-on: "depot-ubuntu-24.04-4" |
51 | 49 | steps: |
52 | 50 | - uses: "actions/checkout@v5" |
53 | 51 | - uses: "authzed/actions/setup-go@main" |
|
56 | 54 | # go env gopath won't point at the right install location for the |
57 | 55 | # wasm tool. |
58 | 56 | go-version: "1.23.2" |
59 | | - cache: "false" # do not cache to prevent cache poisoning |
| 57 | + - name: "Disable AppArmor" |
| 58 | + if: |
| 59 | + "runner.os == 'Linux'" |
| 60 | + # Disable AppArmor for Ubuntu 23.10+. |
| 61 | + # https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md |
| 62 | + run: "echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns" |
60 | 63 | - name: "Install wasmbrowsertest" |
61 | 64 | run: "go install github.com/agnivade/wasmbrowsertest@latest" |
| 65 | + # cleanenv is a util provided by the wasmbrowsertest package that removes |
| 66 | + # environment variables from the environment handed to wasmbrowsertest. |
| 67 | + # this works around https://github.com/agnivade/wasmbrowsertest/issues/40, |
| 68 | + # which we were experiencing on depot. |
| 69 | + - name: "Install cleanenv" |
| 70 | + run: "go install github.com/agnivade/wasmbrowsertest/cmd/cleanenv@latest" |
62 | 71 | - name: "Run WASM Tests" |
63 | | - run: "GOOS=js GOARCH=wasm go test ./pkg/wasm/... -exec $(go env GOPATH)/bin/wasmbrowsertest" |
| 72 | + # There's a whole bunch of vars in the environment that aren't needed for running this test, so we clear them out. |
| 73 | + # NOTE: if you need to do this in the future, I recommend bashing into the container and running `env | sort | less` |
| 74 | + run: |- |
| 75 | + GOOS=js \ |
| 76 | + GOARCH=wasm \ |
| 77 | + cleanenv \ |
| 78 | + -remove-prefix GITHUB_ \ |
| 79 | + -remove-prefix ANDROID_ \ |
| 80 | + -remove-prefix JAVA_ \ |
| 81 | + -remove-prefix DOTNET_ \ |
| 82 | + -remove-prefix RUNNER_ \ |
| 83 | + -remove-prefix HOMEBREW_ \ |
| 84 | + -remove-prefix runner_ \ |
| 85 | + -- \ |
| 86 | + go test ./pkg/wasm/... -exec $(go env GOPATH)/bin/wasmbrowsertest |
0 commit comments