Skip to content

Commit

Permalink
Testing finalization e2e in a feature net
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin-Radecki committed Aug 17, 2023
1 parent 9c50450 commit 48af487
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
name: Short session integration tests (Nightly)

name: E2E logic tests (Nightly pipeline)
on:
workflow_call:
schedule:
- cron: '00 23 * * *'
# testing, remove
workflow_dispatch:
push:
branches:
- A0-2902

jobs:
check-vars-and-secrets:
Expand All @@ -16,9 +18,8 @@ jobs:
needs: [check-vars-and-secrets]
name: Build production node and e2e client docker image
uses: ./.github/workflows/_build-production-node-and-e2e-client-image.yml
secrets: inherit
with:
build-synthetic-network-docker: true
build-e2e-client: true

check-if-featurenet-ecr-image-exists:
name: Check if featurenet image exists
Expand Down Expand Up @@ -74,7 +75,7 @@ jobs:
push-featurnet-node-image-to-ecr:
needs: [store-test-node-and-runtime]
if: ${{ needs.check-if-featurenet-ecr-image-exists.outputs.image_exists == "false" }}
name: Build and push PR tesdocker image to ECR
name: Build and push PR test docker image to ECR
uses: ./.github/workflows/_build-and-push-pull-request-image-to-featurenets.yml
secrets: inherit

Expand All @@ -88,19 +89,6 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Delete old featurenet app and data
uses: ./.github/actions/delete-featurenet
with:
gh-ci-token: ${{ secrets.CI_GH_TOKEN }}
aws-access-key-id: ${{ secrets.AWS_DEVNET_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEVNET_SECRET_ACCESS_KEY }}
ecr-public-registry: ${{ vars.ECR_PUBLIC_REGISTRY }}
argo-sync-user-token: ${{ secrets.ARGO_SYNC_USER_TOKEN }}
repo-apps-name: ${{ secrets.REPO_ARGOCD_APPS_NAME }}
repo-featurenets-name: ${{ secrets.REPO_OPS_FEATURENETS_NAME }}
argo-host: ${{ secrets.ARGOCD_DEVNET_HOST }}
featurenet-keys-s3bucket-name: ${{ secrets.FEATURENET_KEYS_S3BUCKET_NAME }}

- name: Call action get-ref-properties
id: get-ref-properties
uses: Cardinal-Cryptography/github-actions/get-ref-properties@v1
Expand All @@ -115,31 +103,39 @@ jobs:
argo-host: ${{ secrets.ARGOCD_DEVNET_HOST }}
ecr-public-registry: ${{ vars.ECR_PUBLIC_REGISTRY }}
featurenet-keys-s3bucket-name: ${{ secrets.FEATURENET_KEYS_S3BUCKET_NAME }}
expiration: ${{ inputs.expiration == '' && '48h' || inputs.expiration }}
expiration: '3h'

- name: Wait for the aleph-node binary to accept some blocks
uses: ./.github/actions/wait-for-finalized-heads
with:
gh-ci-token: ${{ secrets.CI_GH_TOKEN }}
repo-apps-name: ${{ secrets.REPO_ARGOCD_APPS_NAME }}
# yamllint disable-line rule:line-length
json-rpc-endpoint: https://ws-fe-${{ steps.get-ref-properties.outputs.branch-name-for-argo }}.dev.azero.dev
json-rpc-endpoint: https://ws-fe-${{ steps.get-ref-properties.outputs.branch-name-for-argo }}-${{ github.run_id }}.dev.azero.dev

- name: Download artifact with the test suite image
if: inputs.test-case != ''
uses: actions/download-artifact@v2
with:
name: aleph-e2e-client

- name: Load test suite docker image
if: inputs.test-case != ''
shell: bash
run: docker load -i aleph-e2e-client.tar

# TODO goal is to run only below
# e2e-tests$ RUST_LOG=info NODE_URL=wss://ws-fe-a0-1564.dev.azero.dev:443 cargo test --release finalization::finalization -- --nocapture
# - name: Run e2e test
# uses: ./.github/actions/run-e2e-test
# with:
# test-case: finalization::finalization
# timeout-minutes: 2
- name: Run finalization e2e test
shell: bash
run: |
docker run --network host -e NODE_URL="wss://ws-fe-${{ steps.get-ref-properties.outputs.branch-name-for-argo }}-${{ github.run_id }}.dev.azero.dev:443" -e TEST_CASES="finalization::finalization" -e RUST_LOG=info aleph-e2e-client:latest
- name: Delete old featurenet app and data
uses: ./.github/actions/delete-featurenet
with:
gh-ci-token: ${{ secrets.CI_GH_TOKEN }}
aws-access-key-id: ${{ secrets.AWS_DEVNET_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEVNET_SECRET_ACCESS_KEY }}
ecr-public-registry: ${{ vars.ECR_PUBLIC_REGISTRY }}
argo-sync-user-token: ${{ secrets.ARGO_SYNC_USER_TOKEN }}
repo-apps-name: ${{ secrets.REPO_ARGOCD_APPS_NAME }}
repo-featurenets-name: ${{ secrets.REPO_OPS_FEATURENETS_NAME }}
argo-host: ${{ secrets.ARGOCD_DEVNET_HOST }}
featurenet-keys-s3bucket-name: ${{ secrets.FEATURENET_KEYS_S3BUCKET_NAME }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: Nightly pipeline
name: E2E synthetic network tests (Nightly pipeline)

on:
workflow_dispatch:
schedule:
- cron: '00 23 * * *'
- cron: '00 22 * * *'

concurrency:
group: "${{ github.ref }}-${{ github.workflow }}"
Expand Down Expand Up @@ -46,7 +46,6 @@ jobs:
build-production-node: true
build-synthetic-network-docker: true


run-e2e-high-out-latency:
needs: [build-production-node-and-e2e-client-image]
name: Run high out-latency test
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:focal-20210827
FROM ubuntu:focal

WORKDIR client

RUN apt-get update && apt-get install -y libssl-dev
RUN apt-get update && apt-get install -y libssl-dev ca-certificates

COPY target/release/aleph-e2e-client /usr/local/bin
RUN chmod +x /usr/local/bin/aleph-e2e-client
Expand Down
7 changes: 6 additions & 1 deletion e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ Run a feature net by adding an appropriate label to a pull request, ie `trigger:
, then after its started run

```bash
e2e-tests$ RUST_LOG=info NODE_URL=wss://ws-fe-a0-1564.dev.azero.dev:443 cargo test --release finalization -- --nocapture
e2e-tests$ RUST_LOG=info NODE_URL=wss://ws-fe-a0-29025887979136.dev.azero.dev:443 cargo test --release finalization::finalization -- --nocapture
```

where you can find your feature env address in https://github.com/Cardinal-Cryptography/aleph-node/deployments

In you have docker image of `e2e-client`, you can run above test with command
```bash
docker run --network host -e NODE_URL="wss://ws-fe-a0-29025887979136.dev.azero.dev:443" -e TEST_CASES="finalization::finalization" -e RUST_LOG=info aleph-e2e-client:latest
```

0 comments on commit 48af487

Please sign in to comment.