Skip to content

Commit

Permalink
Merge pull request #157 from neonevm/test-updating
Browse files Browse the repository at this point in the history
Test updating
  • Loading branch information
kristinaNikolaevaa authored Dec 1, 2023
2 parents 072f6d3 + bdb5a4a commit 659c3f3
Show file tree
Hide file tree
Showing 258 changed files with 10,797 additions and 3,889 deletions.
12 changes: 10 additions & 2 deletions .github/actions/dockerize-neon-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ inputs:
description: 'branch name for oz tests'
required: true
default: master
version_tag:
description: 'neon-tests version tag'
required: false
default: ''
docker_username:
description: 'docker hub username'
required: true
Expand All @@ -22,11 +26,15 @@ runs:
id: docker_pipeline
shell: bash
run: |
image_id="neonlabsorg/neon_tests"
image_id="${{ vars.DOCKERHUB_ORG_NAME }}/neon_tests"
delimeter=$(printf "%0.s-" {1..30})
echo " ${delimeter} Build new docker image ${image_id} ${delimeter}"
docker build . --tag ${image_id}:${{ inputs.image_tag }} --build-arg OZ_BRANCH='${{ inputs.oz_branch }}'
docker build . --no-cache --tag ${image_id}:${{ inputs.image_tag }} --build-arg OZ_BRANCH='${{ inputs.oz_branch }}'
if [[ "${{ inputs.version_tag }}" != '' ]]; then
docker tag ${image_id}:${{ inputs.image_tag }} ${image_id}:${{ inputs.version_tag }}
fi;
echo "${delimeter} Login into Docker registry as ${{ inputs.docker_username }} ${delimeter}"
echo "${{ inputs.docker_password }}" | docker login -u ${{ inputs.docker_username }} --password-stdin
echo "${delimeter} Push image ${image_id} to Docker registry ${delimeter}"
docker push --all-tags ${image_id}
16 changes: 11 additions & 5 deletions .github/actions/generate-allure-report/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ inputs:
description: 'aws secret access key'
required: true
tests_name:
description: 'basic/oz/economic'
description: 'basic/oz/economic/ui'
required: true
runs:
using: composite
Expand All @@ -25,7 +25,7 @@ runs:
docker exec -i ${{ inputs.container }} tar -czvf ./allure-results.tar.gz /opt/neon-tests/allure-results
docker cp ${{ inputs.container }}:/opt/neon-tests/allure-results.tar.gz ./
shell: bash
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: always()
with:
name: "allure-results.tar.gz"
Expand All @@ -38,13 +38,13 @@ runs:
-e AWS_ACCESS_KEY_ID=${{ inputs.aws_access_key_id }} \
-e AWS_SECRET_ACCESS_KEY=${{ inputs.aws_secret_access_key }} \
${{ inputs.container }} \
./clickfile.py allure get-history ${{ inputs.tests_name }} \
python3 ./clickfile.py allure get-history ${{ inputs.tests_name }} \
--network ${{ inputs.network }}
- name: "Generate allure report"
if: always()
shell: bash
run: |
docker exec -i ${{ inputs.container }} ./clickfile.py allure generate
docker exec -i ${{ inputs.container }} python3 ./clickfile.py allure generate
- name: "Upload allure history"
if: always()
shell: bash
Expand All @@ -54,4 +54,10 @@ runs:
-e AWS_ACCESS_KEY_ID=${{ inputs.aws_access_key_id }} \
-e AWS_SECRET_ACCESS_KEY=${{ inputs.aws_secret_access_key }} \
${{ inputs.container }} \
./clickfile.py allure upload-report ${{ inputs.tests_name }} --network ${{ inputs.network }}
python3 ./clickfile.py allure upload-report ${{ inputs.tests_name }} --network ${{ inputs.network }}
- name: "Add result info to github page summary"
if: always()
shell: bash
run: |
docker cp ${{ inputs.container }}:/opt/neon-tests/allure_report_info ./
cat allure_report_info >> $GITHUB_STEP_SUMMARY
2 changes: 1 addition & 1 deletion .github/actions/python-requirements/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ runs:
python-version: "3.9"
- name: "Install python requirements"
run: |
pip3 install --upgrade -r deploy/requirements/prod.txt -r deploy/requirements/devel.txt -r deploy/requirements/ui.txt
pip3 install --upgrade -r deploy/requirements/click.txt
shell: bash
21 changes: 0 additions & 21 deletions .github/actions/requirements/action.yml

This file was deleted.

21 changes: 13 additions & 8 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: "Basic tests"

run-name: Basic tests / ${{ github.event.pull_request.title || github.event_name }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: "0 23,2 * * 0,1,2,3,4"
# - cron: "0 0,4,8,12,16,20 * * *"
- cron: "0 4 * * 0,1,2,3,4"
pull_request:
types: [ opened, reopened, synchronize ]
workflow_dispatch:
Expand Down Expand Up @@ -32,6 +35,7 @@ on:
required: true
description: "Number of parallel jobs"
options:
- 2
- 4
- 8
- 12
Expand All @@ -42,7 +46,7 @@ env:
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
SOLANA_URL: "${{ secrets.SOLANA_URL }}"
NUMPROCESSES: 4
IMAGE: neonlabsorg/neon_tests
IMAGE: ${{ vars.DOCKERHUB_ORG_NAME }}/neon_tests
CONTAINER: basic-${{ github.run_id }}
jobs:
dockerize:
Expand All @@ -68,7 +72,7 @@ jobs:
echo "NETWORK=night-stand" >> $GITHUB_ENV
- name: Setup `devnet` by cron schedule
id: setup_devnet
if: github.event.schedule=='0 0,4,8,12,16,20 * * *'
if: github.event.schedule=='0 4 * * 0,1,2,3,4'
run: |
echo "NETWORK=devnet" >> $GITHUB_ENV
- name: Setup env
Expand All @@ -88,7 +92,7 @@ jobs:
NETWORK=$( setVar "${{ github.event.inputs.network }}" "${{ env.NETWORK }}" )
RUNNER=$( setVar "${{ github.event.inputs.runner }}" "${{ env.RUNNER }}" )
NUMPROCESSES=$( setVar "${{ github.event.inputs.numprocesses }}" "${{ env.NUMPROCESSES }}" )
NUMPROCESSES=$( setVar "${{ github.event.inputs.numprocesses }}" "2" )
echo "Network: ${NETWORK}"
echo "Runner: ${RUNNER}"
Expand Down Expand Up @@ -126,17 +130,18 @@ jobs:
- name: Run docker container
run: |
docker pull ${{ env.IMAGE }}:${{ steps.image_tag.outputs.tag }}
docker run -i -d -e CI -e GITHUB_RUN_ID -e GITHUB_WORKFLOW -e BANK_PRIVATE_KEY -e PROXY_URL -e SOLANA_URL --name=${{ env.CONTAINER }} ${{ env.IMAGE }}:${{ steps.image_tag.outputs.tag }} /bin/bash
docker run -i -d -e CI -e GITHUB_RUN_ID -e GITHUB_WORKFLOW -e BANK_PRIVATE_KEY=${{ secrets.BANK_PRIVATE_KEY }} -e PROXY_URL -e SOLANA_URL --name=${{ env.CONTAINER }} ${{ env.IMAGE }}:${{ steps.image_tag.outputs.tag }} /bin/bash
- name: "Run basic tests"
timeout-minutes: 60
id: basic
run: |
docker exec -i ${{ env.CONTAINER }} \
./clickfile.py run basic -n ${{ env.NETWORK }} --numprocesses ${{ env.NUMPROCESSES }}
python3 ./clickfile.py run basic -n ${{ env.NETWORK }} --numprocesses ${{ env.NUMPROCESSES }}
- name: "Notify on failure."
if: failure()
run: |
docker exec -i ${{ env.CONTAINER }} \
./clickfile.py send-notification -u ${{ secrets.SLACK_QA_CHANNEL_URL }} \
python3 ./clickfile.py send-notification -u ${{ secrets.SLACK_QA_CHANNEL_URL }} \
-b ${{ env.BUILD_URL }} -n ${{ needs.prepare-env.outputs.network }}
- name: "Generate allure report"
if: always()
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/compiler_cmpatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: "Compilers compatibility tests"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: "0 22 * * 2"
workflow_dispatch:
inputs:
network:
type: choice
default: devnet
required: true
description: "Stand name"
options:
- night-stand
- devnet
- private-devnet

env:
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
SOLANA_URL: "${{ secrets.SOLANA_URL }}"
NUMPROCESSES: 2
IMAGE: ${{ vars.DOCKERHUB_ORG_NAME }}/neon_tests
CONTAINER: compilers-${{ github.run_id }}
jobs:
dockerize:
if: ${{ github.ref_name != 'develop'}}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: "Dockerize neon tests"
id: requirements
uses: ./.github/actions/dockerize-neon-tests
with:
image_tag: ${{ github.sha }}
docker_username: ${{ secrets.DOCKER_USERNAME }}
docker_password: ${{ secrets.DOCKER_PASSWORD }}

tests:
name: "Compiler compatibility tests"
needs:
- dockerize
if: |
always() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
runs-on: ubuntu-20.04
env:
NETWORK: ${{ github.event.inputs.network || 'devnet'}}
steps:
- uses: actions/checkout@v3
- name: "Define image tag"
id: image_tag
uses: ./.github/actions/define-image-tag
- name: Run docker container
run: |
docker pull ${{ env.IMAGE }}:${{ steps.image_tag.outputs.tag }}
docker run -i -d -e CI -e GITHUB_RUN_ID -e GITHUB_WORKFLOW -e BANK_PRIVATE_KEY=${{ secrets.BANK_PRIVATE_KEY }} -e PROXY_URL -e SOLANA_URL --name=${{ env.CONTAINER }} ${{ env.IMAGE }}:${{ steps.image_tag.outputs.tag }} /bin/bash
- name: "Run tests"
timeout-minutes: 20
run: |
docker exec -i ${{ env.CONTAINER }} \
python3 ./clickfile.py run compiler_compatibility -n ${{ env.NETWORK }} --numprocesses ${{ env.NUMPROCESSES }}
- name: "Notify on failure"
if: failure()
run: |
docker exec -i ${{ env.CONTAINER }} \
python3 ./clickfile.py send-notification -u ${{ secrets.SLACK_QA_CHANNEL_URL }} \
-b ${{ env.BUILD_URL }} -n ${{ env.NETWORK }}
- name: "Generate allure report"
if: always()
id: requirements
uses: ./.github/actions/generate-allure-report
with:
container: ${{ env.CONTAINER }}
network: ${{ env.NETWORK }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
tests_name: compiler_compatibility
- name: Remove docker container
if: always()
run: docker rm -f ${{ env.CONTAINER }}
Loading

0 comments on commit 659c3f3

Please sign in to comment.