diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3182005..70598ac 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -44,13 +44,21 @@ jobs: run: cargo clippy -- -Dwarnings - name: Build run: cargo build - - name: Tests + - name: Integration tests env: GOLEM_DOCKER_SERVICES: true GOLEM_TEST_TEMPLATES: ./test-templates RUST_LOG: info CI: true - run: cargo test + run: cargo test --test integration + - name: Sharding tests + env: + GOLEM_DOCKER_SERVICES: true + GOLEM_TEST_TEMPLATES: ./test-templates + RUST_LOG: info + CI: true + run: cargo test --test sharding + timeout-minutes: 10 publish: needs: [build] if: "startsWith(github.ref, 'refs/tags/v')" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b88cbb4..d37c058 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,13 +9,20 @@ You can run all tests with To run individual tests you should first build all executables with `./scripts/build-all.sh` and then run tests by name: ```shell -GOLEM_DOCKER_SERVICES=true GOLEM_TEST_TEMPLATES="./test-templates" cargo test worker_new_instance +GOLEM_DOCKER_SERVICES=true GOLEM_TEST_TEMPLATES="./test-templates" cargo test --test integration worker_new_instance ``` With `QUIET=true` you can hide services output: ```shell -QUIET=true GOLEM_DOCKER_SERVICES=true GOLEM_TEST_TEMPLATES="./test-templates" cargo test +QUIET=true GOLEM_DOCKER_SERVICES=true GOLEM_TEST_TEMPLATES="./test-templates" cargo test --test integration ``` This way tests will use configured versions of golem docker images. To run tests against the latest binaries without docker - see [`golem-services` CONTRIBUTING.md](https://github.com/golemcloud/golem-services/blob/main/CONTRIBUTING.md) + +## Running sharding tests + +Same as integration tests, but with `--test sharding` instead of `--test integration`: +```shell +QUIET=true GOLEM_DOCKER_SERVICES=true GOLEM_TEST_TEMPLATES="./test-templates" cargo test --test sharding +``` diff --git a/scripts/it.sh b/scripts/it.sh index 0e317f4..afa1239 100755 --- a/scripts/it.sh +++ b/scripts/it.sh @@ -6,4 +6,4 @@ script_full_path=$(dirname "$0") cd "${script_full_path}"/.. || exit ./scripts/build-all.sh -GOLEM_DOCKER_SERVICES=true GOLEM_TEST_TEMPLATES="./test-templates" RUST_LOG=info cargo test +GOLEM_DOCKER_SERVICES=true GOLEM_TEST_TEMPLATES="./test-templates" RUST_LOG=info cargo test --test integration diff --git a/test-templates/option-service.wasm b/test-templates/option-service.wasm new file mode 100755 index 0000000..b1f7f03 Binary files /dev/null and b/test-templates/option-service.wasm differ diff --git a/tests/context.rs b/tests/context.rs index 40d73f3..cf57bd5 100644 --- a/tests/context.rs +++ b/tests/context.rs @@ -16,7 +16,7 @@ use std::path::PathBuf; use testcontainers::clients; const NETWORK: &str = "golem_test_network"; -const TAG: &str = "v0.0.63"; +const TAG: &str = "v0.0.67"; #[derive(Debug, Clone)] pub struct EnvConfig {