Skip to content

Commit

Permalink
A0-3735: Add featurenet test automation (#1553)
Browse files Browse the repository at this point in the history
# Description

This PR
* changes update net test scenario (Mainnet -> `main`) to be Mainnet ->
Testnet
* splits update net tests into two workflow for readability
* adds three weekly workflows that tests featurenets internals. They
will be migrated to different repo at some point.

## Type of change

Please delete options that are not relevant.

- New feature (non-breaking change which adds functionality)

## Testing

Links updated after rework
34eb77c

* [Weekly test featurenets create (short session,
branch)](https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/7287465811)
* [Weekly test featurenets create (short session,
tag)](https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/7287465807)
* [Weekly test featurenets create (short session, full
sha)](https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/7287465816)
* [Nightly update net test from Testnet to
main](https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/7287465815)
* [Nightly update net test from Mainnet to
Testnet](https://github.com/Cardinal-Cryptography/aleph-node/actions/runs/7287465809)
  • Loading branch information
Marcin-Radecki authored Dec 22, 2023
1 parent 787c391 commit a028091
Show file tree
Hide file tree
Showing 9 changed files with 377 additions and 192 deletions.
36 changes: 35 additions & 1 deletion .github/workflows/featurenet-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,41 @@ on:
sudo-account-id:
description: 'Sudo account ID'
type: string
required: false
default: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY'
workflow_call:
inputs:
featurenet-name:
description: 'Name of the featurenet'
type: string
required: true
ref:
description: "git ref: full commit hash, branch, tag - or 'mainnet' or 'testnet'"
type: string
required: true
expiration:
description: 'Time after which featurenet will be removed'
required: true
type: string
default: '48h'
validators:
description: 'Number of validators to start, from 0 to 50'
required: true
default: '5'
type: string
internal:
description: 'Internal network, accessible from VPN only'
required: true
type: boolean
default: false
short-session:
description: 'Use short session aleph-node binary'
required: true
type: boolean
sudo-account-id:
description: 'Sudo account ID'
type: string
required: false
default: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY'

jobs:
Expand Down Expand Up @@ -100,7 +134,7 @@ jobs:
needs: [get-full-docker-image-path, build-and-push-featurenet-node-image]
# to prevent this job to be skipped when on of the parent jobs is skipped
if: ${{ !cancelled() }}
name: Create featurenet from branch
name: Create featurenet
uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-create.yml@v6
secrets: inherit
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/featurenet-delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
delete-featurenet:
needs: [check-vars-and-secrets]
name: Delete featurenet
# yamllint disable-line rule:line-length
uses: Cardinal-Cryptography/github-actions/.github/workflows/_featurenet-delete.yml@v5
secrets: inherit
with:
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/featurenet-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@ on:
description: 'Use short session aleph-node binary'
required: true
type: boolean
workflow_call:
inputs:
featurenet-name:
description: 'Name of featurenet'
required: true
type: string
ref:
description: 'git ref: full commit hash, branch, tag'
required: true
type: string
rolling-update-partition:
description: |
A number from 0 to N-1, where N is a number of validators.
All aleph-node-validator-N with an ordinal N that is great than or equal to the partition
will be updated. If not specified, all nodes will be updated.
required: true
default: "0"
type: string
short-session:
description: 'Use short session aleph-node binary'
required: true
type: boolean

jobs:
validate-inputs:
Expand Down
190 changes: 0 additions & 190 deletions .github/workflows/nightly-update-net-tests.yml

This file was deleted.

73 changes: 73 additions & 0 deletions .github/workflows/nightly-update-test-mainnet-testnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
# This workflow performs from Mainnet to Testnet update.
# Test means that net starts from plain (empty) aleph-node chain, bootstraped using starting
# node image, and then performs rolling restart to target node image
# What this test validates are changes in finalization area to aleph-node binary

name: Nightly update net test from Mainnet to Testnet
on:
workflow_dispatch:
# Daily at 02:00
schedule:
- cron: '00 02 * * *'

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: false

jobs:
check-vars-and-secrets:
name: Check vars and secrets
uses: ./.github/workflows/_check-vars-and-secrets.yml
secrets: inherit

create-featurenet-from-mainnet:
needs: [check-vars-and-secrets]
name: Create featurenet from mainnet
uses: ./.github/workflows/featurenet-create.yml
secrets: inherit
with:
featurenet-name: 'ops-updatenet-mainnet'
ref: 'mainnet'
expiration: '4h'
validators: '7'
internal: true
short-session: false

update-featurenet-to-testnet:
needs: [create-featurenet-from-mainnet]
name: Update featurenet to Testnet
uses: ./.github/workflows/featurenet-update.yml
secrets: inherit
with:
featurenet-name: 'ops-updatenet-mainnet'
ref: 'testnet'
rolling-update-partition: '0'
short-session: false

delete-featurenet:
if: ${{ always() }}
needs: [update-featurenet-to-testnet]
name: Delete featurenet
uses: ./.github/workflows/featurenet-delete.yml
secrets: inherit
with:
featurenet-name: 'ops-updatenet-mainnet'

slack-notification:
name: Slack notification
runs-on: ubuntu-20.04
needs: [delete-featurenet]
if: >
!cancelled() &&
github.event_name != 'workflow_dispatch'
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Send Slack message
uses: ./.github/actions/slack-notification
with:
notify-on: "failure"
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEV_ONDUTY }}
Loading

0 comments on commit a028091

Please sign in to comment.