diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index cb1c84afcf..6c75388f1b 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -2,7 +2,9 @@ name: Playwright Tests on: push: - branches: "disabled" + branches: "**" + pull_request: + branches: "**" # schedule: # - cron: "30 22 * * *" workflow_dispatch: @@ -33,7 +35,7 @@ jobs: contents: read steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name : Set URL environment Variable run: | echo "URL=http://localhost:8000" >> $GITHUB_ENV @@ -94,114 +96,114 @@ jobs: - name: Setup management cluster run: | - ./utils/scripts/mgmt-cluster-setup.sh ${{ env.MANAGEMENT_CLUSTER_TYPE }} $(pwd) ${{ env.CLUSTER_NAME }} + ./playwright/utils/scripts/mgmt-cluster-setup.sh ${{ env.MANAGEMENT_CLUSTER_TYPE }} $(pwd) ${{ env.CLUSTER_NAME }} - name: Extract branch name run: | echo "branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT id: extract_branch - - name: Setup wego enterprise - run: | - kubectl create namespace flux-system - flux install - kubectl create secret generic git-provider-credentials -n flux-system --from-literal=username="weave-gitops-bot" --from-literal=password="${WEAVEWORKS_BOT_TOKEN}" - sed -i 's/BRANCH_NAME/${{ steps.extract_branch.outputs.branch_name }}/' ./utils/scripts/resources/flux-system-gitrepo.yaml - ./utils/scripts/wego-enterprise.sh setup ./utils/scripts - - - name: Install violating-app - run: | - kubectl apply -f ./utils/data/violating-podinfo-kustomization.yaml - - - name: Install policies - run: | - kubectl apply -f ./utils/data/policies.yaml - - - name: Flux reconcile violating app - run: | - flux reconcile kustomization violating-podinfo -n default --with-source || true - kubectl get pods -A - - - name: Install gitopsset-configmaps - run: | - kubectl apply -f ./utils/data/gitops-sets-kustomization.yaml - - - name: run tests - if: success() - run: | - pytest -s -v --video=retain-on-failure --screenshot=only-on-failure --template=html1/index.html --report=test-results/test-run-report.html -o junit_family=xunit2 --junit-xml=test-results/junit_test_report.xml - - - name: Generate tests report - if: always() - uses: pmeier/pytest-results-action@main - with: - path: test-results/junit_test_report.xml - summary: true - display-options: fEX - fail-on-empty: true - - - name: Upload test report - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 - if: success() || failure() - with: - name: playwright-tests-report - path: test-results/ - retention-days: 3 - - - name: Download test artifacts - uses: actions/download-artifact@v4.1.8 - if: success() || failure() - with: - name: playwright-tests-report - path: test-results/ - - - name: Display structure of downloaded files - if: always() - run: ls -R - working-directory: test-results - - - name: Publish test report - id: test_summary - uses: mikepenz/action-junit-report@v5.2.0 - if: success() || failure() - with: - report_paths: test-results/junit_test_report.xml - - - name: Notify Slack - id: slack - uses: slackapi/slack-github-action@v2.0.0 - with: - channel-id: C058RPVS5DZ - payload: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Tests result:*" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Tests :test_tube:\t\t\tPassed :check:\t\t\tSkipped :arrow_right_hook:\t\t\tFailed :x:\n>executed:*${{steps.test_summary.outputs.total}}*\t\t\tpassed:*${{steps.test_summary.outputs.passed}}*\t\t\tskipped:*${{steps.test_summary.outputs.skipped}}*\t\t\tfailed:*${{steps.test_summary.outputs.failed}}*" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*View result on Github:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - } - } - ] - } - if: always() - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK +# - name: Setup wego enterprise +# run: | +# kubectl create namespace flux-system +# flux install +# kubectl create secret generic git-provider-credentials -n flux-system --from-literal=username="weave-gitops-bot" --from-literal=password="${WEAVEWORKS_BOT_TOKEN}" +# sed -i 's/BRANCH_NAME/${{ steps.extract_branch.outputs.branch_name }}/' ./utils/scripts/resources/flux-system-gitrepo.yaml +# ./utils/scripts/wego-enterprise.sh setup ./utils/scripts +# +# - name: Install violating-app +# run: | +# kubectl apply -f ./utils/data/violating-podinfo-kustomization.yaml +# +# - name: Install policies +# run: | +# kubectl apply -f ./utils/data/policies.yaml +# +# - name: Flux reconcile violating app +# run: | +# flux reconcile kustomization violating-podinfo -n default --with-source || true +# kubectl get pods -A +# +# - name: Install gitopsset-configmaps +# run: | +# kubectl apply -f ./utils/data/gitops-sets-kustomization.yaml +# +# - name: run tests +# if: success() +# run: | +# pytest -s -v --video=retain-on-failure --screenshot=only-on-failure --template=html1/index.html --report=test-results/test-run-report.html -o junit_family=xunit2 --junit-xml=test-results/junit_test_report.xml +# +# - name: Generate tests report +# if: always() +# uses: pmeier/pytest-results-action@main +# with: +# path: test-results/junit_test_report.xml +# summary: true +# display-options: fEX +# fail-on-empty: true +# +# - name: Upload test report +# uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 +# if: success() || failure() +# with: +# name: playwright-tests-report +# path: test-results/ +# retention-days: 3 +# +# - name: Download test artifacts +# uses: actions/download-artifact@v4.1.8 +# if: success() || failure() +# with: +# name: playwright-tests-report +# path: test-results/ +# +# - name: Display structure of downloaded files +# if: always() +# run: ls -R +# working-directory: test-results +# +# - name: Publish test report +# id: test_summary +# uses: mikepenz/action-junit-report@v5.2.0 +# if: success() || failure() +# with: +# report_paths: test-results/junit_test_report.xml +# +# - name: Notify Slack +# id: slack +# uses: slackapi/slack-github-action@v2.0.0 +# with: +# channel-id: C058RPVS5DZ +# payload: | +# { +# "blocks": [ +# { +# "type": "section", +# "text": { +# "type": "mrkdwn", +# "text": "*Tests result:*" +# } +# }, +# { +# "type": "section", +# "text": { +# "type": "mrkdwn", +# "text": "Tests :test_tube:\t\t\tPassed :check:\t\t\tSkipped :arrow_right_hook:\t\t\tFailed :x:\n>executed:*${{steps.test_summary.outputs.total}}*\t\t\tpassed:*${{steps.test_summary.outputs.passed}}*\t\t\tskipped:*${{steps.test_summary.outputs.skipped}}*\t\t\tfailed:*${{steps.test_summary.outputs.failed}}*" +# } +# }, +# { +# "type": "section", +# "text": { +# "type": "mrkdwn", +# "text": "*View result on Github:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" +# } +# } +# ] +# } +# if: always() +# env: +# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} +# SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK - name : Delete test cluster if: success() || failure() diff --git a/playwright/pages/gitopssets_page.py b/playwright/deprecated/pages/gitopssets_page.py similarity index 100% rename from playwright/pages/gitopssets_page.py rename to playwright/deprecated/pages/gitopssets_page.py diff --git a/playwright/pages/policies_page.py b/playwright/deprecated/pages/policies_page.py similarity index 100% rename from playwright/pages/policies_page.py rename to playwright/deprecated/pages/policies_page.py diff --git a/playwright/test_weave_gitops_enterprise/test_gitopssets.py b/playwright/deprecated/tests/test_gitopssets.py similarity index 100% rename from playwright/test_weave_gitops_enterprise/test_gitopssets.py rename to playwright/deprecated/tests/test_gitopssets.py diff --git a/playwright/test_weave_gitops_enterprise/test_policies.py b/playwright/deprecated/tests/test_policies.py similarity index 100% rename from playwright/test_weave_gitops_enterprise/test_policies.py rename to playwright/deprecated/tests/test_policies.py diff --git a/playwright/utils/scripts/mgmt-cluster-setup.sh b/playwright/utils/scripts/mgmt-cluster-setup.sh index 1cec2273d2..0ee171acda 100755 --- a/playwright/utils/scripts/mgmt-cluster-setup.sh +++ b/playwright/utils/scripts/mgmt-cluster-setup.sh @@ -87,7 +87,7 @@ function setup_gke { export CLUSTER_NAME=${args[2]} export CLUSTER_REGION=${args[3]} - export CLUSTER_VERSION=1.23.13 + export CLUSTER_VERSION=1.31.0 export CLUSTER_EXISTS=$(gcloud container clusters list | grep -i $CLUSTER_NAME) if [ -z $CLUSTER_EXISTS ]; then @@ -129,7 +129,7 @@ function setup_kind { export CLUSTER_NAME=${args[2]} - kind create cluster --name $CLUSTER_NAME --image=kindest/node:v1.23.4 --config ${args[1]}/utils/data/kind/local-kind-config.yaml + kind create cluster --name $CLUSTER_NAME --image=kindest/node:v1.31.0 --config ${args[1]}/utils/data/kind/local-kind-config.yaml kubectl wait --for=condition=Ready --timeout=120s -n kube-system pods --all kubectl get pods -A exit 0 @@ -141,4 +141,4 @@ elif [ ${args[0]} = 'gke' ]; then setup_gke elif [ ${args[0]} = 'kind' ]; then setup_kind -fi \ No newline at end of file +fi diff --git a/playwright/apps/violating-app/deployment.yaml b/tools/dev-resources/apps/violating-app/deployment.yaml similarity index 100% rename from playwright/apps/violating-app/deployment.yaml rename to tools/dev-resources/apps/violating-app/deployment.yaml diff --git a/playwright/apps/violating-app/kustomization.yaml b/tools/dev-resources/apps/violating-app/kustomization.yaml similarity index 100% rename from playwright/apps/violating-app/kustomization.yaml rename to tools/dev-resources/apps/violating-app/kustomization.yaml diff --git a/playwright/gitops-sets/config-map-generator.yaml b/tools/dev-resources/gitops-sets/config-map-generator.yaml similarity index 100% rename from playwright/gitops-sets/config-map-generator.yaml rename to tools/dev-resources/gitops-sets/config-map-generator.yaml diff --git a/playwright/gitops-sets/dev-info-configmap.yaml b/tools/dev-resources/gitops-sets/dev-info-configmap.yaml similarity index 100% rename from playwright/gitops-sets/dev-info-configmap.yaml rename to tools/dev-resources/gitops-sets/dev-info-configmap.yaml diff --git a/playwright/gitops-sets/kustomization.yaml b/tools/dev-resources/gitops-sets/kustomization.yaml similarity index 100% rename from playwright/gitops-sets/kustomization.yaml rename to tools/dev-resources/gitops-sets/kustomization.yaml diff --git a/playwright/gitops-sets/production-info-configmap.yaml b/tools/dev-resources/gitops-sets/production-info-configmap.yaml similarity index 100% rename from playwright/gitops-sets/production-info-configmap.yaml rename to tools/dev-resources/gitops-sets/production-info-configmap.yaml diff --git a/playwright/gitops-sets/role.yaml b/tools/dev-resources/gitops-sets/role.yaml similarity index 100% rename from playwright/gitops-sets/role.yaml rename to tools/dev-resources/gitops-sets/role.yaml diff --git a/playwright/gitops-sets/staging-info-configmap.yaml b/tools/dev-resources/gitops-sets/staging-info-configmap.yaml similarity index 100% rename from playwright/gitops-sets/staging-info-configmap.yaml rename to tools/dev-resources/gitops-sets/staging-info-configmap.yaml diff --git a/playwright/shared-secrets/entitlement-secret.yaml b/tools/dev-resources/shared-secrets/entitlement-secret.yaml similarity index 100% rename from playwright/shared-secrets/entitlement-secret.yaml rename to tools/dev-resources/shared-secrets/entitlement-secret.yaml