Skip to content

Commit

Permalink
Merge branch 'main' into as-move-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
alvicsam authored Nov 29, 2024
2 parents d774228 + 522e0a0 commit a78d95a
Show file tree
Hide file tree
Showing 23 changed files with 485 additions and 338 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/arc-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test ARC Runner

on:
workflow_dispatch:

jobs:
test-arc-runner:
runs-on: zombienet-arc-runner
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js environment
uses: actions/setup-node@v3
with:
node-version: '22'

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test

- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
path: ./test-results/

- name: Notify on completion
if: always()
run: echo "Test completed on zombienet-arc-runner"
4 changes: 2 additions & 2 deletions .github/workflows/k8s-cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
uses: actions/checkout@v4

- name: Setup gcloud CLI
uses: google-github-actions/[email protected].1
uses: google-github-actions/[email protected].2
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
project_id: ${{ env.PROJECT_ID }}
export_default_credentials: true

- name: Login to GCP
uses: google-github-actions/[email protected].6
uses: google-github-actions/[email protected].7
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}

Expand Down
37 changes: 19 additions & 18 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ variables:
CACHE_COMPRESSION_LEVEL: "fastest"
FF_USE_FASTZIP: "true"
PUSHGATEWAY_URL: "http://zombienet-prometheus-pushgateway.managed-monitoring:9091/metrics/job/zombie-metrics"
DEBUG: "zombie,zombie::network-node,zombie::kube::client::logs"

cache:
- key:
Expand Down Expand Up @@ -237,26 +238,26 @@ zombienet-upgrade-node:
--local-dir="${LOCAL_DIR}"
--test="0001-upgrade-node.zndsl"

paras:
extends:
- .zombienet-common
variables:
GH_DIR: "https://github.com/paritytech/zombienet/tree/${CI_COMMIT_SHORT_SHA}/tests/paras"
# paras:
# extends:
# - .zombienet-common
# variables:
# GH_DIR: "https://github.com/paritytech/zombienet/tree/${CI_COMMIT_SHORT_SHA}/tests/paras"

before_script:
- echo "Zombienet Paras smoke test"
- echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
- echo "${GH_DIR}"
- export DEBUG=zombie
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/paritypr/polkadot-debug:master"
- export BIFROST_COL_IMAGE=docker.io/bifrostnetwork/bifrost:latest
- export MOONBEAM_COL_IMAGE=docker.io/purestake/moonbeam:v0.26
- export OAK_COL_IMAGE=docker.io/oaknetwork/turing:latest
# before_script:
# - echo "Zombienet Paras smoke test"
# - echo "paritypr/zombienet:${CI_COMMIT_SHORT_SHA}"
# - echo "${GH_DIR}"
# - export DEBUG=zombie
# - export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/paritypr/polkadot-debug:master"
# - export BIFROST_COL_IMAGE=docker.io/bifrostnetwork/bifrost:latest
# - export MOONBEAM_COL_IMAGE=docker.io/purestake/moonbeam:v0.26
# - export OAK_COL_IMAGE=docker.io/oaknetwork/turing:latest

script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}"
--test="paras.zndsl"
# script:
# - /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
# --local-dir="${LOCAL_DIR}"
# --test="paras.zndsl"

# db-snapshot:
# extends:
Expand Down
2 changes: 1 addition & 1 deletion crates/parser-wrapper/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dsl-parser-wrapper"
version = "0.1.10"
version = "0.1.11"
edition = "2021"
description = "Zombienet DSL parser: produces a test definition, in json format, that can be used with the ZombieNet's test-runnner."
license = "GPL-3.0-or-later"
Expand Down
2 changes: 2 additions & 0 deletions crates/parser-wrapper/todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
wasm-pack build --target nodejs --scope zombienet
cd pkg && npm publish --access=public
2 changes: 1 addition & 1 deletion crates/parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "parser"
version = "0.0.1"
version = "0.0.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
3 changes: 3 additions & 0 deletions crates/parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ fn parse_custom_script_rule(
Rule::double_quoted_string => {
args = Some(inner_record.as_str().trim_matches('"').to_owned());
}
Rule::single_quoted_string => {
args = Some(inner_record.as_str().trim_matches('\'').to_owned());
}
Rule::comparison => {
cmp = Some(parse_comparison(inner_record)?);
}
Expand Down
30 changes: 30 additions & 0 deletions crates/parser/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,36 @@ fn custom_js_with_args_parse_ok() {
assert_eq!(result, t);
}

#[test]
fn custom_js_with_single_quotes_args_parse_ok() {
let line: &str =
r#"alice: js-script ./0008-custom.js with '{"a":1,"b":["demo"]}' within 200 seconds"#;
let data = r#"{
"description": null,
"network": "./a.toml",
"creds": "config",
"assertions": [
{
"original_line": "alice: js-script ./0008-custom.js with '{\"a\":1,\"b\":[\"demo\"]}' within 200 seconds",
"parsed": {
"fn": "CustomJs",
"args": {
"node_name": "alice",
"file_path": "./0008-custom.js",
"custom_args": "{\"a\":1,\"b\":[\"demo\"]}",
"timeout": 200,
"is_ts": false
}
}
}
]
}"#;
let t: TestDefinition = serde_json::from_str(data).unwrap();

let result = parse(&[NETWORK, CREDS, line].join("\n")).unwrap();
assert_eq!(result, t);
}

#[test]
fn custom_ts_parse_ok() {
let line: &str = r#"alice: ts-script ./0008-custom-ts.ts within 200 seconds"#;
Expand Down
2 changes: 1 addition & 1 deletion crates/parser/src/zombienet.pest
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ log_match = { node_name ~ "log line" ~ ("contains"|"matches") ~ match_type? ~ do
count_log_match = { node_name ~ "count of log lines" ~ ("containing"|"matching") ~ match_type? ~ double_quoted_string ~ "is" ~ (comparison | int+) ~ within? }
trace = { node_name ~ "trace with traceID" ~ span_id ~ "contains" ~ square_brackets_strings ~ within? }
system_event = { node_name ~ "system event" ~ ("contains"|"matches") ~ match_type? ~ double_quoted_string ~ within? }
custom_js = { node_name ~ "js-script" ~ file_path ~ ("with" ~ double_quoted_string)? ~ ( "return" ~ comparison )? ~ within? }
custom_js = { node_name ~ "js-script" ~ file_path ~ ("with" ~ (double_quoted_string|single_quoted_string))? ~ ( "return" ~ comparison )? ~ within? }
custom_ts = { node_name ~ "ts-script" ~ file_path ~ ("with" ~ double_quoted_string)? ~ ( "return" ~ comparison )? ~ within? }
custom_sh = { node_name ~ "run" ~ file_path ~ ("with" ~ double_quoted_string)? ~ ( "return" ~ comparison )? ~ within? }

Expand Down
2 changes: 1 addition & 1 deletion flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
...
}: let
# this change on each change of dependencies, unfortunately this hash not yet automatically updated from SRI of package.lock
npmDepsHash = "sha256-P/VOAKfGd5wbGvcSaRkL/CEGdWjeQ6LG5+SogFNryMY=";
npmDepsHash = "sha256-j4M/Tdt28AnXmfaJZT1MHMWvtB+9+Ap24ncwofXcTWs=";
####

# there is officia polkadot on nixpkgs, but it has no local rococo wasm to run
Expand Down
Loading

0 comments on commit a78d95a

Please sign in to comment.