Skip to content

Commit

Permalink
Merge branch 'main' into test-fw-http
Browse files Browse the repository at this point in the history
# Conflicts:
#	golem-test-framework/src/components/component_service/mod.rs
  • Loading branch information
noise64 committed Feb 3, 2025
2 parents 16a9d00 + 82bd98e commit a048882
Show file tree
Hide file tree
Showing 81 changed files with 1,770 additions and 1,715 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ jobs:
run: cargo make --profile ci check
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
if: always()
with:
report_paths: '**/target/report-*.xml'
detailed_summary: true
Expand Down Expand Up @@ -273,6 +273,8 @@ jobs:
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare WIT dependencies
run: cargo make wit
- name: Build wasm-rpc in stub mode
run: cargo component build -p golem-wasm-rpc --no-default-features --features stub

Expand Down Expand Up @@ -308,7 +310,7 @@ jobs:
timeout-minutes: 20
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
if: always()
with:
report_paths: '**/target/report-*.xml'
detailed_summary: true
Expand Down Expand Up @@ -358,7 +360,7 @@ jobs:
timeout-minutes: 40
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
if: always()
with:
report_paths: '**/target/report-*.xml'
detailed_summary: true
Expand Down Expand Up @@ -402,13 +404,15 @@ jobs:
timeout-minutes: 30
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
if: always()
with:
report_paths: '**/target/report-*.xml'
detailed_summary: true
include_passed: true
cli-tests:
runs-on: ubuntu-latest-xlarge
env:
CARGO_BUILD_JOBS: 6
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -441,7 +445,7 @@ jobs:
timeout-minutes: 35
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
if: always()
with:
report_paths: '**/target/report-*.xml'
detailed_summary: true
Expand Down Expand Up @@ -482,7 +486,7 @@ jobs:
timeout-minutes: 40
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
if: always()
with:
report_paths: '**/target/report-*.xml'
detailed_summary: true
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ golem-client/*
logs
data
.DS_Store
wit/deps
wasm-rpc/wit/deps
durable-wasi/wit/deps
16 changes: 8 additions & 8 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ testcontainers-modules = { version = "0.11.4", features = [
"redis",
"minio",
] }
test-r = { version = "2.0.1", default-features = true }
test-r = { version = "2.1.0", default-features = true }
thiserror = "2.0.6"
tokio = { version = "1.42", features = [
"macros",
Expand Down
62 changes: 48 additions & 14 deletions Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# List of top-level tasks intended for use:
#
# - `cargo make dev-flow` or just `cargo make`: runs a full development flow, including fixing format and clippy, building and running tests and generating OpenAPI specs
# - `cargo make wit`: fetches the WIT dependencies based on wit/deps.toml
# - `cargo make build`: builds everything in debug mode
# - `cargo make build-release`: builds everything in release mode. customizable with PLATFORM_OVERRIDE env variable for docker builds
# - `cargo make check`: runs rustfmt and clippy checks without applying any fix
Expand Down Expand Up @@ -46,13 +47,35 @@ alias = "dev-flow"
[tasks.dev-flow]
description = "Runs a full development flow, including fixing format and clippy, building and running tests"
dependencies = [
"wit",
"fix",
"check",
"build",
# "test"
]

# WIT DEPENDENCIES
[tasks.wit]
description = "Fetches the WIT dependencies based on wit/deps.toml"
dependencies = ["wit-host", "wit-wasm-rpc"]

[tasks.wit-wasm-rpc]
dependencies = ["wit-host"]
script_runner = "@duckscript"
script = """
rm -r wasm-rpc/wit/deps
mkdir wasm-rpc/wit/deps
cp wit/deps/io wasm-rpc/wit/deps
cp wit/deps/wasm-rpc wasm-rpc/wit/deps
"""

[tasks.wit-host]
install_crate = { crate_name = "wit-deps-cli", binary = "wit-deps", test_arg = "--help" }
command = "wit-deps"
args = ["update"]

[tasks.build]
dependencies = ["wit"]
description = "Builds everything in debug mode"
command = "cargo"
args = ["build", "--workspace", "--all-targets"]
Expand All @@ -64,16 +87,19 @@ condition = { env_not_set = [
run_task = "build-bins"

[tasks.build-bins]
dependencies = ["wit"]
description = "Builds all executables in debug mode"
command = "cargo"
args = ["build", "--workspace", "--bins"]

[tasks.build-worker-service]
dependencies = ["wit"]
description = "Builds the worker-service"
command = "cargo"
args = ["build", "-p", "golem-worker-service"]

[tasks.build-component-service]
dependencies = ["wit"]
description = "Builds the component-service"
command = "cargo"
args = ["build", "-p", "golem-component-service"]
Expand All @@ -83,6 +109,7 @@ description = """This is the top-level task that builds everything in release mo
to build for other target than the current one, can be linux/amd64 or linux/arm64. This is used for cross-compiling
for docker images."""
dependencies = [
"wit",
"set-version",
"build-release-default",
"build-release-override-linux-amd64",
Expand Down Expand Up @@ -115,7 +142,7 @@ args = ["build", "--release", "--target", "aarch64-unknown-linux-gnu"]

[tasks.check]
description = "Runs rustfmt and clippy checks without applying any fix"
dependencies = ["check-clippy", "check-rustfmt"]
dependencies = ["wit", "check-clippy", "check-rustfmt"]

[tasks.check-rustfmt]
description = "Runs rustfmt checks without applying any fix"
Expand All @@ -133,7 +160,7 @@ args = ["clippy", "--all-targets", "--", "--no-deps", "-Dwarnings"]

[tasks.fix]
description = "Runs rustfmt and clippy checks and applies fixes"
dependencies = ["fix-clippy", "fix-rustfmt"]
dependencies = ["wit", "fix-clippy", "fix-rustfmt"]

[tasks.fix-rustfmt]
description = "Runs rustfmt checks and applies fixes"
Expand All @@ -154,7 +181,6 @@ args = [
"--no-deps",
"-Dwarnings",
]

## ** TEST **

[tasks.test]
Expand All @@ -168,13 +194,15 @@ dependencies = [
]

[tasks.unit-tests]
dependencies = ["wit"]
description = "Runs unit tests only"
script = '''
cargo test --workspace --lib --all-features --exclude wasm-rpc-stubgen-tests-integration -- --nocapture --report-time $JUNIT_OPTS
cargo test -p golem-wasm-ast --tests --all-features -- --nocapture --report-time $JUNIT_OPTS
'''

[tasks.worker-executor-tests]
dependencies = ["wit"]
description = "Runs worker executor tests only"
env = { "WASMTIME_BACKTRACE_DETAILS" = "1", "RUST_BACKTRACE" = "1", "RUST_LOG" = "info" }
command = "cargo"
Expand All @@ -189,62 +217,68 @@ args = [
]

[tasks.worker-executor-tests-group1]
dependencies = ["wit"]
description = "Runs worker executor tests only (group 1/8)"
env = { "RUST_BACKTRACE" = "1", "WASMTIME_BACKTRACE_DETAILS" = "1", "RUST_LOG" = "info", "RUST_TEST_TIME_INTEGRATION" = "5000,30000" }
script = '''
cargo test --package golem-worker-executor-base --test integration :tag: -- --nocapture --report-time $JUNIT_OPTS
cargo test --package golem-worker-executor-base --test integration :tag:group1 -- --nocapture --report-time $JUNIT_OPTS
cargo test --package golem-worker-executor-base --test integration :tag: -- --report-time --nocapture $JUNIT_OPTS
cargo test --package golem-worker-executor-base --test integration :tag:group1 -- --report-time --nocapture $JUNIT_OPTS
'''

[tasks.worker-executor-tests-group2]
dependencies = ["wit"]
description = "Runs worker executor tests only (group 2/8)"
env = { "RUST_BACKTRACE" = "1", "WASMTIME_BACKTRACE_DETAILS" = "1", "RUST_LOG" = "info", "RUST_TEST_TIME_INTEGRATION" = "5000,30000" }
script = '''
cargo test --package golem-worker-executor-base --test integration :tag:group2 -- --nocapture --report-time $JUNIT_OPTS
cargo test --package golem-worker-executor-base --test integration :tag:group2 -- --report-time --nocapture $JUNIT_OPTS
'''

[tasks.worker-executor-tests-group3]
dependencies = ["wit"]
description = "Runs worker executor tests only (group 3/8)"
env = { "RUST_BACKTRACE" = "1", "WASMTIME_BACKTRACE_DETAILS" = "1", "RUST_LOG" = "info", "RUST_TEST_TIME_INTEGRATION" = "5000,30000" }
script = '''
cargo test --package golem-worker-executor-base --test integration :tag:group3 -- --nocapture --report-time $JUNIT_OPTS
cargo test --package golem-worker-executor-base --test integration :tag:group3 -- --report-time --nocapture $JUNIT_OPTS
'''

[tasks.worker-executor-tests-group4]
dependencies = ["wit"]
description = "Runs worker executor tests only (group 4/8)"
env = { "RUST_BACKTRACE" = "1", "WASMTIME_BACKTRACE_DETAILS" = "1", "RUST_LOG" = "info", "RUST_TEST_TIME_INTEGRATION" = "5000,30000" }
script = '''
cargo test --package golem-worker-executor-base --test integration :tag:group4 -- --nocapture --report-time $JUNIT_OPTS --test-threads=1
cargo test --package golem-worker-executor-base --test integration :tag:group4 -- --report-time --nocapture $JUNIT_OPTS
'''
# NOTE: temporarily set test-threads=1 to debug flakyness

[tasks.worker-executor-tests-group5]
dependencies = ["wit"]
description = "Runs worker executor tests only (group 5/8)"
env = { "RUST_BACKTRACE" = "1", "WASMTIME_BACKTRACE_DETAILS" = "1", "RUST_LOG" = "info", "RUST_TEST_TIME_INTEGRATION" = "5000,30000" }
script = '''
cargo test --package golem-worker-executor-base --test integration :tag:group5 -- --nocapture --report-time $JUNIT_OPTS
cargo test --package golem-worker-executor-base --test integration :tag:group5 -- --report-time --nocapture $JUNIT_OPTS
'''


[tasks.worker-executor-tests-group6]
dependencies = ["wit"]
description = "Runs worker executor tests only (group 6/8)"
env = { "RUST_BACKTRACE" = "1", "WASMTIME_BACKTRACE_DETAILS" = "1", "RUST_LOG" = "info", "RUST_TEST_TIME_INTEGRATION" = "5000,30000" }
script = '''
cargo test --package golem-worker-executor-base --test integration :tag:group6 -- --nocapture --report-time $JUNIT_OPTS
cargo test --package golem-worker-executor-base --test integration :tag:group6 -- --report-time --nocapture $JUNIT_OPTS
'''

[tasks.worker-executor-tests-group7]
dependencies = ["wit"]
description = "Runs worker executor tests only (group 7/8)"
env = { "RUST_BACKTRACE" = "1", "WASMTIME_BACKTRACE_DETAILS" = "1", "RUST_LOG" = "info", "RUST_TEST_TIME_INTEGRATION" = "5000,30000" }
script = '''
cargo test --package golem-worker-executor-base --test integration :tag:group7 -- --nocapture --report-time $JUNIT_OPTS
cargo test --package golem-worker-executor-base --test integration :tag:group7 -- --report-time --nocapture $JUNIT_OPTS
'''

[tasks.worker-executor-tests-group8]
dependencies = ["wit"]
description = "Runs worker executor tests only (group 8/8)"
env = { "RUST_BACKTRACE" = "1", "WASMTIME_BACKTRACE_DETAILS" = "1", "RUST_LOG" = "info", "RUST_TEST_TIME_INTEGRATION" = "5000,30000" }
script = '''
cargo test --package golem-worker-executor-base --test integration :tag:group8 -- --nocapture --report-time $JUNIT_OPTS
cargo test --package golem-worker-executor-base --test integration :tag:group8 -- --report-time --nocapture $JUNIT_OPTS
'''

[tasks.integration-tests]
Expand Down
3 changes: 2 additions & 1 deletion golem-cli/src/examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ pub fn new(
match example {
Some(example) => {
let cwd = env::current_dir().expect("Failed to get current working directory");
let target_path = cwd.join(component_name.as_str());
match instantiate_example(
example,
&ExampleParameters {
component_name,
package_name: package_name
.unwrap_or(PackageName::from_string("golem:component").unwrap()),
target_path: cwd,
target_path,
},
TargetExistsResolveMode::Fail,
) {
Expand Down
2 changes: 1 addition & 1 deletion golem-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include = ["src/**/*", "Cargo.toml", "build.rs", "openapi/**/*"]
harness = false

[dependencies]
golem-common = { path = "../golem-common", version = "=0.0.0", default-features = false }
golem-common = { path = "../golem-common", version = "=0.0.0", default-features = false, features = ["model"] }
golem-wasm-ast = { path = "../wasm-ast", version = "=0.0.0", default-features = false, features = ["analysis"] }
golem-wasm-rpc = { path = "../wasm-rpc", version = "=0.0.0", default-features = false }

Expand Down
Loading

0 comments on commit a048882

Please sign in to comment.