Skip to content
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

ci: Enable the wasm-wasi-component tests #1402

Merged
merged 4 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
File renamed without changes.
2 changes: 1 addition & 1 deletion test/unit/applications/lang/wasm_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def prepare_env(script):
def load(self, script, **kwargs):
self.prepare_env(script)

component_path = f'{option.temp_dir}/wasm_component/{script}/target/wasm32-wasi/release/test_wasi_component.wasm'
component_path = f'{option.temp_dir}/wasm_component/{script}/target/wasm32-wasip1/release/test_wasi_component.wasm'

self._load_conf(
{
Expand Down
2 changes: 1 addition & 1 deletion test/unit/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def find_diffs(d1, d2):
if k in d2
}

if isinstance(d1, str):
if isinstance(d1, str) or isinstance(d1, list):
return d1 == d2

return d1 - d2
Expand Down