Skip to content

Commit

Permalink
use in the same context
Browse files Browse the repository at this point in the history
  • Loading branch information
rsporny committed Sep 18, 2024
1 parent 98a80ba commit a272ae1
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 115 deletions.
106 changes: 101 additions & 5 deletions .github/workflows/modules/local-environment-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
jobs:
local-environment-tests:
runs-on: ubuntu-latest
env:
TEST_ENVIRONMENT: demo
steps:
- name: Checkout master
uses: actions/checkout@v4
Expand Down Expand Up @@ -60,11 +62,105 @@ jobs:
bash setup.sh --non-interactive --overrides --postgres-password=azMpOp4mTqhlKDmgCVQr --node-image=${{ inputs.image }}
docker compose up -d
- name: Run e2e tests
runs-on: ubuntu-latest
steps:
- uses: ./partner-chains-master/.github/workflows/modules/run-e2e-tests.yml
secrets: inherit
- name: Checkout e2e tests
uses: actions/checkout@v4
with:
repository: input-output-hk/sidechains-tests
token: ${{ secrets.ACTIONS_PAT }}
ref: ETCM-8119/run-tests-on-ci
path: e2e-tests

- name: Setup python and dependencies
run: |
cd e2e-tests
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y python3.10 python3.10-venv python3.10-dev
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
curl -L --silent https://github.com/getsops/sops/releases/download/v3.7.3/sops_3.7.3_amd64.deb > sops.deb && sudo dpkg -i sops.deb && rm sops.deb
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Wait for the PC node 1 to start
run: |
while ! docker exec cardano-node-1 [ -e /shared/cardano.ready ]; do sleep 1; done
echo "Cardano network is ready! Waiting for Partner Chain first node to start..."
INIT_TIMESTAMP=$(docker exec cardano-node-1 cat /shared/cardano.start)
echo "INIT_TIMESTAMP=$INIT_TIMESTAMP" >> $GITHUB_ENV
while ! docker exec partner-chains-node-1 [ -e /shared/partner-chains-node-1.ready ]; do \
epoch=$(docker exec cardano-node-1 cardano-cli query tip --testnet-magic 42 | jq -r .epoch) && \
echo "Epoch: $epoch" && \
sleep 10; \
done
- name: Run smoke tests
uses: ./partner-chains-master/.github/run-e2e-tests
with:
env: ${{ env.TEST_ENVIRONMENT }}
keyword: "test_get_status or test_get_params"

- name: Wait for epoch 3
uses: ./partner-chains-masters/.github/wait-for-epoch
with:
epoch: 3

- name: Run registration tests
uses: ./partner-chains-master/.github/run-tests
with:
env: ${{ env.TEST_ENVIRONMENT }}
keyword: "test_register_candidate or test_deregister_candidate or test_add_permissioned_candidate or test_remove_permissioned_candidate"
init_timestamp: ${{ env.INIT_TIMESTAMP }}

- name: Wait for epoch 4
uses: ./partner-chains-master/.github/wait-for-epoch
with:
epoch: 4

- name: Run registration tests
uses: ./partner-chains-master/.github/run-tests
with:
env: ${{ env.TEST_ENVIRONMENT }}
keyword: "test_register_candidate or test_deregister_candidate or test_add_permissioned_candidate or test_remove_permissioned_candidate"
init_timestamp: ${{ env.INIT_TIMESTAMP }}

- name: Wait for epoch 5
uses: ./partner-chains-master/.github/wait-for-epoch
with:
epoch: 5

- name: Run all tests
uses: ./partner-chains-master/.github/run-tests
with:
env: ${{ env.TEST_ENVIRONMENT }}
mc_epoch: 4
init_timestamp: ${{ env.INIT_TIMESTAMP }}

- name: Wait for epoch 6
uses: ./partner-chains-master/.github/wait-for-epoch
with:
epoch: 6

- name: Run all tests
uses: ./partner-chains-master/.github/run-tests
with:
env: ${{ env.TEST_ENVIRONMENT }}
mc_epoch: 5
init_timestamp: ${{ env.INIT_TIMESTAMP }}

- name: Wait for epoch 7
uses: ./partner-chains-master/.github/wait-for-epoch
with:
epoch: 7

- name: Run all tests
uses: ./partner-chains-master/.github/run-tests
with:
env: ${{ env.TEST_ENVIRONMENT }}
mc_epoch: 6
init_timestamp: ${{ env.INIT_TIMESTAMP }}

- name: Stop partner-chains-demo
run: docker compose down --volumes
110 changes: 0 additions & 110 deletions .github/workflows/modules/run-e2e-tests.yml

This file was deleted.

0 comments on commit a272ae1

Please sign in to comment.