Skip to content

Commit 8461f2c

Browse files
committed
chore: get playwright working again
1 parent 25dece3 commit 8461f2c

27 files changed

+130
-225
lines changed

.github/workflows/nightly.yaml

Lines changed: 121 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: Playwright Tests
22

33
on:
44
push:
5-
branches: "disabled"
5+
branches: "**"
6+
pull_request:
7+
branches: "**"
68
# schedule:
79
# - cron: "30 22 * * *"
810
workflow_dispatch:
@@ -33,7 +35,7 @@ jobs:
3335
contents: read
3436

3537
steps:
36-
- uses: actions/checkout@v3
38+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3739
- name : Set URL environment Variable
3840
run: |
3941
echo "URL=http://localhost:8000" >> $GITHUB_ENV
@@ -69,13 +71,16 @@ jobs:
6971
sudo mv ./kubectl /usr/local/bin/kubectl
7072
kubectl version --client
7173
72-
- name: Install kind
73-
run: |
74-
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64
75-
chmod +x ./kind
76-
sudo mv ./kind /usr/local/bin/kind
77-
which kind
78-
kind version
74+
- name: Kubernetes KinD Cluster
75+
id: kind
76+
uses: helm/kind-action@v1
77+
with:
78+
cluster_name: 'weave-gitops-community'
79+
kubectl_version: v1.31.0
80+
registry: true
81+
registry_name: werave-registry
82+
registry_port: 5001
83+
registry_enable_delete: true
7984

8085
- name: Install playwright
8186
run: |
@@ -88,122 +93,127 @@ jobs:
8893
- name: Lint with flake8
8994
run: |
9095
# stop the build if there are Python syntax errors or undefined names
91-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
96+
flake8 ./playwright --count --select=E9,F63,F7,F82 --show-source --statistics
9297
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
93-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
94-
95-
- name: Setup management cluster
96-
run: |
97-
./utils/scripts/mgmt-cluster-setup.sh ${{ env.MANAGEMENT_CLUSTER_TYPE }} $(pwd) ${{ env.CLUSTER_NAME }}
98+
flake8 ./playwright --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
9899
99100
- name: Extract branch name
100101
run: |
101102
echo "branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
102103
id: extract_branch
103104

104-
- name: Setup wego enterprise
105+
- name: Setup flux
105106
run: |
106107
kubectl create namespace flux-system
107-
flux install
108-
kubectl create secret generic git-provider-credentials -n flux-system --from-literal=username="weave-gitops-bot" --from-literal=password="${WEAVEWORKS_BOT_TOKEN}"
109-
sed -i 's/BRANCH_NAME/${{ steps.extract_branch.outputs.branch_name }}/' ./utils/scripts/resources/flux-system-gitrepo.yaml
110-
./utils/scripts/wego-enterprise.sh setup ./utils/scripts
108+
kubectl create namespace violations
109+
flux install --components-extra="image-reflector-controller,image-automation-controller"
110+
sleep 5
111+
kubectl rollout status deployment/source-controller -n flux-system
112+
kubectl rollout status deployment/kustomize-controller -n flux-system
113+
kubectl rollout status deployment/helm-controller -n flux-system
114+
kubectl rollout status deployment/notification-controller -n flux-system
115+
kubectl rollout status deployment/image-reflector-controller -n flux-system
116+
kubectl rollout status deployment/image-automation-controller -n flux-system
117+
echo
118+
kubectl get deployments -n flux-system
119+
120+
- name: Install test resources
121+
run: |
122+
kubectl apply -k tools/dev-resources
123+
sleep 30
124+
kubectl rollout status deployment/kube-prometheus-stack-grafana -n monitoring
125+
kubectl rollout status deployment/podinfo -n default
126+
sleep 30
127+
kubectl rollout status DaemonSet/loki-stack-promtail -n monitoring
128+
kubectl get DaemonSet/loki-stack-promtail -n monitoring
111129
112130
- name: Install violating-app
113131
run: |
114-
kubectl apply -f ./utils/data/violating-podinfo-kustomization.yaml
115-
116-
- name: Install policies
117-
run: |
118-
kubectl apply -f ./utils/data/policies.yaml
132+
kubectl apply -f ./tools/dev-resources/data/violating-podinfo-kustomization.yaml
119133
120134
- name: Flux reconcile violating app
121135
run: |
122-
flux reconcile kustomization violating-podinfo -n default --with-source || true
136+
flux reconcile kustomization violating-podinfo -n violations --with-source || true
123137
kubectl get pods -A
124138
125-
- name: Install gitopsset-configmaps
126-
run: |
127-
kubectl apply -f ./utils/data/gitops-sets-kustomization.yaml
128-
129-
- name: run tests
130-
if: success()
131-
run: |
132-
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
133-
134-
- name: Generate tests report
135-
if: always()
136-
uses: pmeier/pytest-results-action@main
137-
with:
138-
path: test-results/junit_test_report.xml
139-
summary: true
140-
display-options: fEX
141-
fail-on-empty: true
142-
143-
- name: Upload test report
144-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
145-
if: success() || failure()
146-
with:
147-
name: playwright-tests-report
148-
path: test-results/
149-
retention-days: 3
150-
151-
- name: Download test artifacts
152-
uses: actions/download-artifact@v4.1.8
153-
if: success() || failure()
154-
with:
155-
name: playwright-tests-report
156-
path: test-results/
157-
158-
- name: Display structure of downloaded files
159-
if: always()
160-
run: ls -R
161-
working-directory: test-results
162-
163-
- name: Publish test report
164-
id: test_summary
165-
uses: mikepenz/action-junit-report@v5.2.0
166-
if: success() || failure()
167-
with:
168-
report_paths: test-results/junit_test_report.xml
169-
170-
- name: Notify Slack
171-
id: slack
172-
uses: slackapi/slack-github-action@v2.0.0
173-
with:
174-
channel-id: C058RPVS5DZ
175-
payload: |
176-
{
177-
"blocks": [
178-
{
179-
"type": "section",
180-
"text": {
181-
"type": "mrkdwn",
182-
"text": "*Tests result:*"
183-
}
184-
},
185-
{
186-
"type": "section",
187-
"text": {
188-
"type": "mrkdwn",
189-
"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}}*"
190-
}
191-
},
192-
{
193-
"type": "section",
194-
"text": {
195-
"type": "mrkdwn",
196-
"text": "*View result on Github:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
197-
}
198-
}
199-
]
200-
}
201-
if: always()
202-
env:
203-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
204-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
205-
206-
- name : Delete test cluster
207-
if: success() || failure()
208-
run: |
209-
kind delete clusters --all
139+
# - name: run tests
140+
# if: success()
141+
# run: |
142+
# 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
143+
#
144+
# - name: Generate tests report
145+
# if: always()
146+
# uses: pmeier/pytest-results-action@main
147+
# with:
148+
# path: test-results/junit_test_report.xml
149+
# summary: true
150+
# display-options: fEX
151+
# fail-on-empty: true
152+
#
153+
# - name: Upload test report
154+
# uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
155+
# if: success() || failure()
156+
# with:
157+
# name: playwright-tests-report
158+
# path: test-results/
159+
# retention-days: 3
160+
#
161+
# - name: Download test artifacts
162+
# uses: actions/download-artifact@v4.1.8
163+
# if: success() || failure()
164+
# with:
165+
# name: playwright-tests-report
166+
# path: test-results/
167+
#
168+
# - name: Display structure of downloaded files
169+
# if: always()
170+
# run: ls -R
171+
# working-directory: test-results
172+
#
173+
# - name: Publish test report
174+
# id: test_summary
175+
# uses: mikepenz/action-junit-report@v5.2.0
176+
# if: success() || failure()
177+
# with:
178+
# report_paths: test-results/junit_test_report.xml
179+
#
180+
# - name: Notify Slack
181+
# id: slack
182+
# uses: slackapi/slack-github-action@v2.0.0
183+
# with:
184+
# channel-id: C058RPVS5DZ
185+
# payload: |
186+
# {
187+
# "blocks": [
188+
# {
189+
# "type": "section",
190+
# "text": {
191+
# "type": "mrkdwn",
192+
# "text": "*Tests result:*"
193+
# }
194+
# },
195+
# {
196+
# "type": "section",
197+
# "text": {
198+
# "type": "mrkdwn",
199+
# "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}}*"
200+
# }
201+
# },
202+
# {
203+
# "type": "section",
204+
# "text": {
205+
# "type": "mrkdwn",
206+
# "text": "*View result on Github:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
207+
# }
208+
# }
209+
# ]
210+
# }
211+
# if: always()
212+
# env:
213+
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
214+
# SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
215+
216+
# - name : Delete test cluster
217+
# if: success() || failure()
218+
# run: |
219+
# kind delete clusters --all

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ gitops-server.dockerfile
4141
!.yarn/releases
4242
!.yarn/sdks
4343
!.yarn/versions
44+
45+
__pycache__

playwright/pages/gitopssets_page.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

playwright/pages/policies_page.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

playwright/test_weave_gitops_enterprise/test_gitopssets.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

playwright/test_weave_gitops_enterprise/test_policies.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)