Skip to content

Commit

Permalink
ci: Enable the wasm-wasi-component tests
Browse files Browse the repository at this point in the history
We now have tests for this module via commit cad6aed ("Tests: initial
"wasm-wasi-component" test").

We need to install cargo-component for this test target.

Also the only way I found I could get this test to run was by running as
non-root. The issue I was seeing was that despite cargo being installed
into /home/runner/.cargo/bin *and* that being in the path, it kept
claiming it couldn't find cargo. E.g.

  $ sudo -E echo $PATH

Showed /home/runner/.cargo/bin in there.

  $ sudo -E /home/runner/.cargo/bin/cargo -V

Worked.

  $ sudo -E cargo -V

cargo command not found.

(Also other oddities, despite claiming to be using bash, it couldn't
find shell builtins like 'hash' and 'export', perhaps some Ubuntu
weirdness...)

However, no problem, there is *no* need for it run as root anyway so
result!

Signed-off-by: Andrew Clayton <[email protected]>
  • Loading branch information
ac000 committed Aug 28, 2024
1 parent 19cd88e commit 337cba4
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ jobs:
- name: Setup rust
run: |
curl https://sh.rustup.rs | sh -s -- -y
cargo install cargo-component
if: steps.metadata.outputs.module == 'wasm-wasi-component'

- name: Configure wasm-wasi-component
Expand Down Expand Up @@ -347,18 +348,22 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3'
if: steps.metadata.outputs.module != 'wasm' &&
steps.metadata.outputs.module != 'wasm-wasi-component'
if: steps.metadata.outputs.module != 'wasm'

- name: Install pytest
run: |
sudo -H pip install pytest
if: steps.metadata.outputs.module != 'wasm' &&
steps.metadata.outputs.module != 'wasm-wasi-component'
if [ "${{ matrix.build }}" == "wasm-wasi-component" ]; then
pip install pytest
else
sudo -H pip install pytest
fi
if: steps.metadata.outputs.module != 'wasm'

- name: Run ${{ steps.metadata.outputs.module }} tests
run: |
sudo -E pytest --print-log ${{ steps.metadata.outputs.testpath }}
# Skip pytest if wasm build, as there are no tests yet
if: steps.metadata.outputs.module != 'wasm' &&
steps.metadata.outputs.module != 'wasm-wasi-component'
if [ "${{ matrix.build }}" == "wasm-wasi-component" ]; then
pytest --print-log ${{ steps.metadata.outputs.testpath }}
else
sudo -E pytest --print-log ${{ steps.metadata.outputs.testpath }}
fi
if: steps.metadata.outputs.module != 'wasm'

0 comments on commit 337cba4

Please sign in to comment.