Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #92 from golemcloud/vigoo/test-r
Browse files Browse the repository at this point in the history
Migrated to test-r
  • Loading branch information
vigoo authored Oct 9, 2024
2 parents 7bae83f + 5710c1a commit edc361f
Show file tree
Hide file tree
Showing 24 changed files with 224 additions and 28 deletions.
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

0 comments on commit edc361f

Please sign in to comment.