diff --git a/.github/workflows/local.yaml b/.github/workflows/local.yaml index 58a2f02..5d841a0 100644 --- a/.github/workflows/local.yaml +++ b/.github/workflows/local.yaml @@ -32,24 +32,16 @@ jobs: echo "Processing para chain: $para_chain, relay chain: $relay_chain" # Call Python script with para_chain and relay_chain as arguments python ./testdata/generate_json.py --relay "$relay_chain" --para "$para_chain" --network "local" - kurtosis run . --args-file ./testdata/updated_config.json --enclave polkadot || true - - # Check if Kurtosis command failed - if [ $? -ne 0 ]; then - echo "Chain $para_chain failed." - failed_chains+=("$para_chain") - else - echo "Chain $para_chain succeeded." - fi + kurtosis run . --args-file ./testdata/updated_config.json --enclave polkadot || failed_chains+=("$para_chain") done < ./testdata/chain_value.csv + if [ ${#failed_chains[@]} -gt 0 ]; then + echo "Failed chains: ${failed_chains[@]}" + else + echo "All chains succeeded." + fi - - name: Print failed chains - run: | - if [ ${#failed_chains[@]} -gt 0 ]; then - echo "Failed chains: ${failed_chains[@]}" - else - echo "All chains succeeded." - fi + + diff --git a/.github/workflows/mainnet.yaml b/.github/workflows/mainnet.yaml index 92a06de..974cac2 100644 --- a/.github/workflows/mainnet.yaml +++ b/.github/workflows/mainnet.yaml @@ -32,25 +32,11 @@ jobs: echo "Processing para chain: $para_chain, relay chain: $relay_chain" # Call Python script with para_chain and relay_chain as arguments python ./testdata/generate_json.py --relay "$relay_chain" --para "$para_chain" --network "mainnet" - kurtosis run . --args-file ./testdata/updated_config.json --enclave polkadot || true - - # Check if Kurtosis command failed - if [ $? -ne 0 ]; then - echo "Chain $para_chain failed." - failed_chains+=("$para_chain") - else - echo "Chain $para_chain succeeded." - fi + kurtosis run . --args-file ./testdata/updated_config.json --enclave polkadot || failed_chains+=("$para_chain") done < ./testdata/chain_value.csv - - - name: Print failed chains - run: | - if [ ${#failed_chains[@]} -gt 0 ]; then - echo "Failed chains: ${failed_chains[@]}" - else - echo "All chains succeeded." - fi - - - + if [ ${#failed_chains[@]} -gt 0 ]; then + echo "Failed chains: ${failed_chains[@]}" + else + echo "All chains succeeded." + fi \ No newline at end of file diff --git a/.github/workflows/smoke.yaml b/.github/workflows/smoke.yaml deleted file mode 100644 index 387d273..0000000 --- a/.github/workflows/smoke.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: smoke-test -on: - workflow_dispatch: - -jobs: - smoke-test: - name: smoke test on all parachains - runs-on: "ubuntu-latest" - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Installing Kurtosis CLI if not found in cache - run: | - if [ ! -f "/usr/bin/kurtosis" ]; then - echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list - sudo apt update - sudo apt install kurtosis-cli - which kurtosis - fi - - - name: Cache Kurtosis CLI - uses: actions/cache@v2 - with: - path: | - /usr/bin/kurtosis - key: kurtosis-${{ runner.os }} - restore-keys: | - kurtosis- - - - name: Starting the Kurtosis engine - run: kurtosis engine start - - # - name: Run parachain - # run: | - # kurtosis run . --args-file ./local.json --enclave polkadot \ No newline at end of file diff --git a/.github/workflows/testnet.yaml b/.github/workflows/testnet.yaml index 8170821..5538a5b 100644 --- a/.github/workflows/testnet.yaml +++ b/.github/workflows/testnet.yaml @@ -28,30 +28,23 @@ jobs: run: | # Read CSV file and extract values while IFS=',' read -r para_chain relay_chain; do - kurtosis clean -a - echo "Processing para chain: $para_chain, relay chain: $relay_chain" - # Call Python script with para_chain and relay_chain as arguments - python ./testdata/generate_json.py --relay "$relay_chain" --para "$para_chain" --network "testnet" - kurtosis run . --args-file ./testdata/updated_config.json --enclave polkadot || true - - # Check if Kurtosis command failed - if [ $? -ne 0 ]; then - echo "Chain $para_chain failed." - failed_chains+=("$para_chain") - else - echo "Chain $para_chain succeeded." - fi - done < ./testdata/chain_value.csv - - - - name: Print failed chains - run: | - if [ ${#failed_chains[@]} -gt 0 ]; then - echo "Failed chains: ${failed_chains[@]}" - else - echo "All chains succeeded." - fi + kurtosis clean -a + echo "Processing para chain: $para_chain, relay chain: $relay_chain" + # Call Python script with para_chain and relay_chain as arguments + + if [ "$para_chain" == 'parallel' ] || [ "$para_chain" == 'subzero' ]; then + echo "testnet not supported for $para_chain" + else + python ./testdata/generate_json.py --relay "$relay_chain" --para "$para_chain" --network "testnet" + kurtosis run . --args-file ./testdata/updated_config.json --enclave polkadot || failed_chains+=("$para_chain") + fi + done < ./testdata/chain_value.csv + if [ ${#failed_chains[@]} -gt 0 ]; then + echo "Failed chains: ${failed_chains[@]}" + else + echo "All chains succeeded." + fi \ No newline at end of file diff --git a/testdata/chain_value.csv b/testdata/chain_value.csv index 7ded96a..a56dda8 100644 --- a/testdata/chain_value.csv +++ b/testdata/chain_value.csv @@ -32,4 +32,5 @@ subzero,Kusama litmus,Kusama moonriver,Kusama calamari,Kusama -phala,Polkadot \ No newline at end of file +phala,Polkadot +end \ No newline at end of file diff --git a/testdata/generate_json.py b/testdata/generate_json.py index b0b7010..a9fe058 100644 --- a/testdata/generate_json.py +++ b/testdata/generate_json.py @@ -18,9 +18,10 @@ def update_config(original_config, relay_chain, para_chain, network): config_data["chain-type"] = "local" config_data["relaychain"]["name"] = relay_chain - name = next(iter(config_data["para"].keys())) + for para in config_data["para"]: + para["name"] = para_chain - config_data["para"][para_chain] = config_data["para"].pop(name) + # config_data["para"][para_chain] = config_data["para"].pop(name) updated_config = json.dumps(config_data, indent=2) # Optionally, save the updated config to a new file