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

Migrated to test-r #92

Merged
merged 6 commits into from
Oct 9, 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
14 changes: 12 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
checks: write

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -46,11 +49,18 @@ jobs:
- name: Clippy
run: cargo clippy -- -Dwarnings
- name: Unit Tests
run: cargo test --workspace --exclude wasm-rpc-stubgen-tests-integration
run: cargo test --tests --workspace --exclude wasm-rpc-stubgen-tests-integration -- --format junit --logfile target/report.xml
- name: WASM RPC stubgen integration tests
run: cargo test --package wasm-rpc-stubgen-tests-integration -- --test-threads=1
run: cargo test --tests --package wasm-rpc-stubgen-tests-integration -- --test-threads=1 --format junit --logfile target/report.xml
- name: Build in stub mode
run: cargo component build -p golem-wasm-rpc --no-default-features --features stub
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/target/report-*.xml'
detailed_summary: true
include_passed: true
publish:
needs: [ build ]
if: "startsWith(github.ref, 'refs/tags/v')"
Expand Down
151 changes: 129 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ opt-level = 's'
fs_extra = "1.3.0"
golem-wasm-ast = "1.0.1"
tempfile = "3.12.0"
test-r = { version = "0.0.6", default-features = false }
tokio = "1.38.0"
13 changes: 13 additions & 0 deletions wasm-rpc-stubgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,20 @@ unstable-dec-dep = []
[lib]
name = "golem_wasm_rpc_stubgen"
path = "src/lib.rs"
harness = false

[[bin]]
name = "wasm-rpc-stubgen"
path = "src/main.rs"
harness = false

[[test]]
name = "wit"
harness = false

[[test]]
name = "add_dep"
harness = false

[dependencies]
anyhow = "1.0.79"
Expand Down Expand Up @@ -51,3 +61,6 @@ walkdir = "2.5.0"
wac-graph = "0.6.0"
wit-bindgen-rust = "=0.26.0"
wit-parser = "0.207.0"

[dev-dependencies]
test-r = { workspace = true }
3 changes: 3 additions & 0 deletions wasm-rpc-stubgen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ use clap::{Parser, Subcommand};
use std::path::PathBuf;
use tempfile::TempDir;

#[cfg(test)]
test_r::enable!();

#[derive(Parser, Debug)]
#[command(name = "wasm-rpc-stubgen", version)]
pub enum Command {
Expand Down
Loading
Loading