-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
109 additions
and
107 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
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/[email protected] | ||
if: success() || failure() | ||
with: | ||
report_paths: test-results/junit_test_report.xml | ||
|
||
- name: Notify Slack | ||
id: slack | ||
uses: slackapi/[email protected] | ||
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/[email protected] | ||
# 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/[email protected] | ||
# if: success() || failure() | ||
# with: | ||
# report_paths: test-results/junit_test_report.xml | ||
# | ||
# - name: Notify Slack | ||
# id: slack | ||
# uses: slackapi/[email protected] | ||
# 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() | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.