Skip to content

Commit

Permalink
add coretime test using zombienet-sdk (#4883)
Browse files Browse the repository at this point in the history
Related to #4882
cc: @s0me0ne-unkn0wn 

```sh
RUST_LOG=info,zombie=debug cargo test -p polkadot-zombienet-sdk-tests smoke::coretime_revenue::coretime_revenue_test --features zombie-metadata  -- --exact
```

---

_Update_: This pr is now ready for review. `warp-sync` failing test are
not related.

---------

Co-authored-by: Dmitry Sinyavin <dmitry.sinyavin@parity.io>
Co-authored-by: s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 18, 2024
1 parent 69e9665 commit ba38d31
Show file tree
Hide file tree
Showing 14 changed files with 2,181 additions and 304 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ rustdocflags = [
# Needed for musl builds so user doesn't have to install musl-tools.
CC_x86_64_unknown_linux_musl = { value = ".cargo/musl-gcc", force = true, relative = true }
CXX_x86_64_unknown_linux_musl = { value = ".cargo/musl-g++", force = true, relative = true }
CARGO_WORKSPACE_ROOT_DIR = { value = "", relative = true }
3 changes: 2 additions & 1 deletion .github/scripts/deny-git-deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
'simple-mermaid': ['xcm-docs'],
# Fix in <https://github.com/paritytech/polkadot-sdk/issues/2922>
'bandersnatch_vrfs': ['sp-core'],
'subwasmlib': ['polkadot-zombienet-sdk-tests'],
}

root = sys.argv[1] if len(sys.argv) > 1 else os.getcwd()
Expand All @@ -24,7 +25,7 @@
def check_dep(dep, used_by):
if dep.location != DependencyLocation.GIT:
return

if used_by in KNOWN_BAD_GIT_DEPS.get(dep.name, []):
print(f'🤨 Ignoring git dependency {dep.name} in {used_by}')
else:
Expand Down
19 changes: 19 additions & 0 deletions .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,25 @@ build-short-benchmark:
- target/release/polkadot --version
- cp ./target/release/polkadot ./artifacts/

build-polkadot-zombienet-tests:
stage: build
extends:
- .docker-env
- .common-refs
- .run-immediately
- .collect-artifacts
needs:
- job: build-linux-stable
artifacts: true
- job: build-linux-stable-cumulus
artifacts: true

script:
- cargo nextest --manifest-path polkadot/zombienet-sdk-tests/Cargo.toml archive --features zombie-metadata --archive-file polkadot-zombienet-tests.tar.zst
- mkdir -p artifacts
- cp polkadot-zombienet-tests.tar.zst ./artifacts


# build jobs from cumulus

build-linux-stable-cumulus:
Expand Down
4 changes: 4 additions & 0 deletions .gitlab/pipeline/zombienet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.105"
PUSHGATEWAY_URL: "http://zombienet-prometheus-pushgateway.managed-monitoring:9091/metrics/job/zombie-metrics"
DEBUG: "zombie,zombie::network-node,zombie::kube::client::logs"
ZOMBIE_PROVIDER: "k8s"
RUST_LOG: "info,zombienet_orchestrator=debug"
RUN_IN_CI: "1"
timeout: 60m

include:
# substrate tests
Expand Down
22 changes: 22 additions & 0 deletions .gitlab/pipeline/zombienet/polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
- echo "colander image ${COL_IMAGE}"
- echo "cumulus image ${CUMULUS_IMAGE}"
- echo "malus image ${MALUS_IMAGE}"
# RUN_IN_CONTAINER is env var that is set in the dockerfile
- if [[ -v RUN_IN_CONTAINER ]]; then
echo "Initializing zombie cluster";
gcloud auth activate-service-account --key-file "/etc/zombie-net/sa-zombie.json";
gcloud container clusters get-credentials parity-zombienet --zone europe-west3-b --project parity-zombienet;
fi
stage: zombienet
image: "${ZOMBIENET_IMAGE}"
needs:
Expand All @@ -54,6 +60,7 @@
MALUS_IMAGE: "docker.io/paritypr/malus"
GH_DIR: "https://github.com/paritytech/substrate/tree/${CI_COMMIT_SHA}/zombienet"
LOCAL_DIR: "/builds/parity/mirrors/polkadot-sdk/polkadot/zombienet_tests"
LOCAL_SDK_TEST: "/builds/parity/mirrors/polkadot-sdk/polkadot/zombienet-sdk-tests"
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1
RUN_IN_CONTAINER: "1"
artifacts:
Expand Down Expand Up @@ -335,3 +342,18 @@ zombienet-polkadot-malus-0001-dispute-valid:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}/integrationtests"
--test="0001-dispute-valid-block.zndsl"

zombienet-polkadot-coretime-revenue:
extends:
- .zombienet-polkadot-common
needs:
- job: build-polkadot-zombienet-tests
artifacts: true
before_script:
- !reference [".zombienet-polkadot-common", "before_script"]
- export POLKADOT_IMAGE="${ZOMBIENET_INTEGRATION_TEST_IMAGE}"
script:
# we want to use `--no-capture` in zombienet tests.
- unset NEXTEST_FAILURE_OUTPUT
- unset NEXTEST_SUCCESS_OUTPUT
- cargo nextest run --archive-file ./artifacts/polkadot-zombienet-tests.tar.zst --no-capture -- smoke::coretime_revenue::coretime_revenue_test
Loading

0 comments on commit ba38d31

Please sign in to comment.