UI tests #140
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "UI Website tests" | |
run-name: UI tests | |
on: | |
schedule: | |
- cron: "0 3 * * 0,1,2,3,4" | |
workflow_dispatch: | |
env: | |
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
IMAGE_NAME: ${{ github.repository_owner }}/neon_tests | |
DOCKER_HUB_ORG_NAME: ${{ github.repository_owner }} | |
CONTAINER_NAME: neon_tests | |
NETWORK: "devnet" | |
jobs: | |
dockerize: | |
name: Dockerize neon tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dockerize neon tests | |
if: ${{ github.ref_name != 'develop' }} | |
uses: ./.github/actions/dockerize-neon-tests | |
with: | |
image_tag: ${{ github.sha }} | |
docker_username: ${{ secrets.DOCKER_USERNAME }} | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
image_name: ${{ env.IMAGE_NAME }} | |
docker_hub_org_name: ${{ env.DOCKER_HUB_ORG_NAME }} | |
- name: "Define image tag" | |
id: image_tag | |
uses: ./.github/actions/define-image-tag | |
outputs: | |
tag: ${{ steps.image_tag.outputs.tag }} | |
test: | |
needs: dockerize | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Run tests container | |
id: run-container | |
run: | | |
IMAGE=${{ env.IMAGE_NAME }}:${{ needs.dockerize.outputs.tag }} | |
docker run -d --name ${{ env.CONTAINER_NAME }} $IMAGE tail -f /dev/null | |
- name: Install Chrome | |
run: | | |
CMD=" | |
apt-get install -y wget | |
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
apt-get install -y ./google-chrome-stable_current_amd64.deb | |
apt-get install -f -y | |
google-chrome-stable --version | |
" | |
docker exec -i ${{ env.CONTAINER_NAME }} bash -c "$CMD" | |
- name: Run tests | |
id: run-tests | |
run: | | |
docker exec -i ${{ env.CONTAINER_NAME }} bash -c "CHROME_EXT_PASSWORD=${{ secrets.CHROME_EXT_PASSWORD }} python3 clickfile.py run ui --network ${{ env.NETWORK }}" | |
- name: "Generate allure report" | |
if: always() | |
uses: ./.github/actions/generate-allure-report | |
with: | |
container: ${{ env.CONTAINER_NAME }} | |
network: ${{ env.NETWORK }} | |
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
tests_name: ui | |
- name: Remove docker container | |
if: always() | |
run: docker rm -f ${{ env.CONTAINER_NAME }} | |
notify: | |
name: Send notification on failure | |
needs: test | |
if: failure() && github.ref_name == 'develop' | |
runs-on: ["self-hosted", "k8s-prod"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install python requirements | |
uses: ./.github/actions/python-requirements | |
- name: Notify on failure | |
run: | | |
python3 ./clickfile.py send-notification -u ${{ secrets.SLACK_QA_CHANNEL_URL }} \ | |
-b ${{ env.BUILD_URL }} --network ${{ env.NETWORK }} --test-group ui |