Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit d92dd9f

Browse files
authored
Restructure and fix stubgen integration tests (#88)
* Restructure and fix stubgen integration tests * fix CI: install cargo component * remove unused crates * CI add missing binstall
1 parent 4439815 commit d92dd9f

File tree

12 files changed

+53
-438
lines changed

12 files changed

+53
-438
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,19 @@ jobs:
3232
run: git fetch origin --deepen=1
3333
- name: Setup Rust
3434
run: rustup update stable --no-self-update && rustup default stable
35-
- uses: Swatinem/rust-cache@v2
36-
with:
37-
shared-key: debug
38-
cache-all-crates: true
39-
save-if: true
4035
- uses: davidB/rust-cargo-make@v1
36+
- uses: cargo-bins/cargo-binstall@main
37+
- name: Install cargo-component
38+
run: cargo binstall --no-confirm [email protected]
4139
- name: Install Protoc
4240
uses: arduino/setup-protoc@v3
4341
with:
4442
repo-token: ${{ secrets.GITHUB_TOKEN }}
43+
- uses: Swatinem/rust-cache@v2
44+
with:
45+
shared-key: debug
46+
cache-all-crates: true
47+
save-if: true
4548
- name: Build all targets
4649
run: cargo make --profile ci build
4750
- name: Unit tests

Cargo.lock

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ members = [
66
"golem-cli",
77
"golem-cloud-cli",
88
"wasm-rpc-stubgen",
9-
"wasm-rpc-stubgen/tests-integration"
109
]
1110

1211
[workspace.dependencies]
1312
# Golem wit - git deps
14-
golem-wit = { git = "https://github.com/golemcloud/golem-wit.git", tag="v1.1.11" }
13+
golem-wit = { git = "https://github.com/golemcloud/golem-wit.git", tag = "v1.1.11" }
1514

1615
# Golem dep
1716
golem-client = "=1.1.20"
@@ -46,7 +45,6 @@ clap_complete = "4.5.45"
4645
cli-table = "0.4.9"
4746
colored = "3.0.0"
4847
derive_more = { version = "2.0.1", features = ["display", "into", "from_str"] }
49-
dir-diff = "0.3.3"
5048
dirs = "6.0.0"
5149
fs_extra = "1.3.0"
5250
futures = "0.3.31"

Makefile.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
# - `cargo make check`: runs rustfmt and clippy checks without applying any fix
77
# - `cargo make fix`: runs rustfmt and clippy checks and applies fixes
88
# - `cargo make test`: runs all tests
9-
# - `cargo make unit-tests`: runs unit test tests
9+
# - `cargo make unit-tests`: runs all unit tests
10+
# - `cargo make integrations-tests`: runs all integrations tests
11+
# - `cargo make stubgen-integrations-tests`: runs stubgen integrations tests only
1012
# - `cargo make publish`: publishes packages to crates.io
1113

1214
[config]
@@ -124,7 +126,12 @@ exec --fail-on-error cargo test --workspace --lib --all-features -- --nocapture
124126

125127
[tasks.integration-tests]
126128
description = "Run integration tests"
129+
dependencies = ["stubgen-integration-tests"]
130+
131+
[tasks.stubgen-integration-tests]
132+
description = "Run stubgen integration tests"
127133
script_runner = "@duckscript"
128134
script = '''
129-
exec --fail-on-error cargo test --package golem-wasm-rpc-stubgen --tests -- --nocapture --report-time %{JUNIT_OPTS}
135+
exec --fail-on-error cargo test --package golem-wasm-rpc-stubgen :tag: --tests -- --nocapture --report-time %{JUNIT_OPTS}
136+
exec --fail-on-error cargo test --package golem-wasm-rpc-stubgen :tag:uses_cargo --tests -- --nocapture --test-threads=1 --report-time %{JUNIT_OPTS}
130137
'''

wasm-rpc-stubgen/Cargo.toml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ homepage = "https://golem.cloud"
77
repository = "https://github.com/golemcloud/golem-cli"
88
description = "Golem WASM RPC stub generator"
99

10+
autotests = false
11+
1012
[lib]
1113
path = "src/lib.rs"
1214
harness = false
@@ -17,11 +19,8 @@ path = "src/main.rs"
1719
test = false
1820

1921
[[test]]
20-
name = "wit"
21-
harness = false
22-
23-
[[test]]
24-
name = "add_dep"
22+
name = "integration"
23+
path = "tests/lib.rs"
2524
harness = false
2625

2726
[dependencies]
@@ -36,10 +35,8 @@ cargo-component-core = { workspace = true }
3635
cargo_toml = { workspace = true }
3736
clap = { workspace = true }
3837
colored = { workspace = true }
39-
dir-diff = { workspace = true }
4038
fs_extra = { workspace = true }
4139
heck = { workspace = true }
42-
id-arena = { workspace = true }
4340
indexmap = { workspace = true }
4441
indoc = { workspace = true }
4542
itertools = { workspace = true }
@@ -48,7 +45,6 @@ pretty_env_logger = { workspace = true }
4845
prettyplease = { workspace = true }
4946
proc-macro2 = { workspace = true }
5047
quote = { workspace = true }
51-
regex = { workspace = true }
5248
semver = { workspace = true }
5349
serde = { workspace = true }
5450
serde_json = { workspace = true }

0 commit comments

Comments
 (0)