Skip to content

Commit dcb4745

Browse files
committed
Merge branch 'master' of https://github.com/navikt/testnorge into feature/dolly-soek-med-dollysearchservice
2 parents 90d6e84 + b821505 commit dcb4745

File tree

237 files changed

+3151
-2048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

237 files changed

+3151
-2048
lines changed

.github/workflows/all.workflows.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ permissions:
4242
id-token: write
4343

4444
jobs:
45-
4645
backend:
4746
if: inputs.workflow == 'backend'
4847
uses: ./.github/workflows/common.workflow.backend.yml
@@ -59,6 +58,9 @@ jobs:
5958
frontend:
6059
if: inputs.workflow == 'frontend'
6160
uses: ./.github/workflows/common.workflow.frontend.yml
61+
permissions:
62+
packages: write
63+
6264
with:
6365
cluster: ${{ inputs.cluster }}
6466
working-directory: "${{ inputs.type }}/${{ inputs.name }}"

.github/workflows/app.dolly-frontend.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,30 @@ on:
1414
- "libs/security-core/**"
1515
- "apps/dolly-frontend/**"
1616
- ".github/workflows/app.dolly-frontend.yml"
17-
- ".github/workflows/common.playwright.yml"
17+
- ".github/workflows/common.playwright-vitest.yml"
1818

1919
jobs:
2020
playwright:
21-
uses: ./.github/workflows/common.playwright.yml
21+
uses: ./.github/workflows/common.playwright-vitest.yml
22+
permissions:
23+
packages: write
24+
id-token: write
25+
contents: read
2226
with:
2327
working-directory: "apps/dolly-frontend"
2428
secrets:
2529
READER_TOKEN: ${{ secrets.READER_TOKEN }}
2630

2731
workflow:
2832
uses: ./.github/workflows/common.workflow.frontend.yml
33+
permissions:
34+
packages: write
35+
id-token: write
36+
contents: read
2937
with:
3038
working-directory: "apps/dolly-frontend"
3139
deploy-tag: "#deploy-frontend"
3240
deploy-tag-test: "#deploy-test-frontend"
3341
deploy-tag-idporten: "#deploy-idporten-frontend"
3442
deploy-tag-unstable: "#deploy-unstable-frontend"
35-
permissions:
36-
contents: read
37-
id-token: write
3843
secrets: inherit

.github/workflows/app.testnorge-statisk-data-forvalter.yml

+1-16
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
11
name: testnorge-statisk-data-forvalter
22

33
on:
4-
push:
5-
paths:
6-
- "plugins/**"
7-
- "libs/avro-schema/**"
8-
- "libs/commands/**"
9-
- "libs/csv-converter/**"
10-
- "libs/data-transfer-objects/**"
11-
- "libs/database/**"
12-
- "libs/kafka-config/**"
13-
- "libs/kafka-producers/**"
14-
- "libs/security-core/**"
15-
- "libs/servlet-core/**"
16-
- "libs/servlet-security/**"
17-
- "libs/testing/**"
18-
- "apps/testnorge-statisk-data-forvalter/**"
19-
- ".github/workflows/app.testnorge-statisk-data-forvalter.yml"
4+
workflow_dispatch:
205

216
jobs:
227
workflow:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Playwright/Vitest Tests
2+
on:
3+
workflow_call:
4+
inputs:
5+
working-directory:
6+
type: string
7+
description: "The working directory for the job, e.g. apps/dolly-frontend (without leading/trailing slash)."
8+
required: true
9+
secrets:
10+
READER_TOKEN:
11+
required: true
12+
13+
jobs:
14+
playwright-tests:
15+
timeout-minutes: 15
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
shardIndex: [ 1, 2, 3, 4 ]
21+
shardTotal: [ 4 ]
22+
env:
23+
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: lts/*
29+
registry-url: https://npm.pkg.github.com/
30+
scope: "@navikt"
31+
- name: Install dependencies
32+
working-directory: ${{ inputs.working-directory }}/src/main/js
33+
run: npm ci
34+
- name: Install Playwright Browsers
35+
working-directory: ${{ inputs.working-directory }}/src/main/js
36+
run: npx playwright install --with-deps
37+
- name: Run Playwright tests
38+
working-directory: ${{ inputs.working-directory }}/src/main/js
39+
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
40+
- name: Upload blob report to GitHub Actions Artifacts
41+
if: ${{ !cancelled() }}
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: blob-report-${{ matrix.shardIndex }}
45+
path: ${{ inputs.working-directory }}/src/main/js/blob-report
46+
retention-days: 1
47+
48+
- name: Run Vitest/RTL tests
49+
if: ${{ matrix.shardIndex == 1 }}
50+
working-directory: ${{ inputs.working-directory }}/src/main/js
51+
run: npm run test:vitest-run
52+
53+
merge-reports:
54+
if: ${{ !cancelled() }}
55+
needs: [ playwright-tests ]
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v4
59+
- uses: actions/setup-node@v4
60+
with:
61+
node-version: 22.x
62+
63+
- name: Download blob reports from GitHub Actions Artifacts
64+
uses: actions/download-artifact@v4
65+
with:
66+
path: ${{ inputs.working-directory }}/src/main/js/all-blob-reports
67+
pattern: blob-report-*
68+
merge-multiple: true
69+
70+
- name: Merge into HTML Report
71+
working-directory: ${{ inputs.working-directory }}/src/main/js
72+
run: npx playwright merge-reports --reporter html ./all-blob-reports
73+
74+
- name: Upload HTML report
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: html-report--attempt-${{ github.run_attempt }}
78+
path: ${{ inputs.working-directory }}/src/main/js/playwright-report
79+
retention-days: 14
80+
81+
- name: Upload HTML report to CDN
82+
uses: nais/deploy/actions/cdn-upload/v2@master
83+
with:
84+
team: dolly
85+
source: ${{ inputs.working-directory }}/src/main/js/playwright-report
86+
destination: /${{ github.repository }}/${{ github.run_number }}
87+
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
88+
# project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
89+
90+
- name: Merge to json report
91+
working-directory: ${{ inputs.working-directory }}/src/main/js
92+
run: npx playwright merge-reports --reporter json ./all-blob-reports > playwright-report/report.json
93+
94+
- name: Make fancy GHA Summary
95+
working-directory: ${{ inputs.working-directory }}/src/main/js
96+
run: |
97+
total_tests=$(jq '.stats.expected + .stats.unexpected' playwright-report/report.json)
98+
passed_tests=$(jq '.stats.expected' playwright-report/report.json)
99+
failed_tests=$(jq '.stats.unexpected' playwright-report/report.json)
100+
failed_test_info=$(jq -r '.suites[].specs[] | select(.ok == false) | "\(.title) (\(.file), \(.tests[].projectName))"' playwright-report/report.json)
101+
echo "## Playwright Test Report Summary" >> $GITHUB_STEP_SUMMARY
102+
echo "Total tests: $total_tests ✅" >> $GITHUB_STEP_SUMMARY
103+
echo "Passed tests: $passed_tests ✅" >> $GITHUB_STEP_SUMMARY
104+
if [ "$failed_tests" -gt 0 ]; then
105+
echo "Failed tests: $failed_tests ❌" >> $GITHUB_STEP_SUMMARY
106+
echo "### Failed Tests:" >> $GITHUB_STEP_SUMMARY
107+
while IFS= read -r test; do
108+
echo "- $test ❌" >> $GITHUB_STEP_SUMMARY
109+
done <<< "$failed_test_info"
110+
else
111+
echo "Failed tests: $failed_tests 🔹" >> $GITHUB_STEP_SUMMARY
112+
fi
113+
echo "Se hele rapporten [her](https://cdn.nav.no/dolly/${{ github.repository }}/${{ github.run_number }}/playwright-report/index.html)." >> $GITHUB_STEP_SUMMARY

.github/workflows/common.playwright.yml

-38
This file was deleted.

.nais/redis-dev.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ spec:
4949
limits:
5050
memory: 128Mi
5151
requests:
52-
cpu: 100m
53-
memory: 128Mi
52+
cpu: 20m
53+
memory: 32Mi
5454
liveness:
5555
path: /health
5656
accessPolicy: # for GCP

.nais/redis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ spec:
4949
limits:
5050
memory: 128Mi
5151
requests:
52-
cpu: 100m
53-
memory: 128Mi
52+
cpu: 20m
53+
memory: 32Mi
5454
liveness:
5555
path: /health
5656
accessPolicy:

apps/adresse-service/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ spec:
3838
min: 1
3939
max: 1
4040
resources:
41+
requests:
42+
cpu: 50m
43+
memory: 800Mi
4144
limits:
4245
memory: 2048Mi
43-
requests:
44-
cpu: 200m
45-
memory: 1024Mi
4646
accessPolicy:
4747
inbound:
4848
rules:

apps/altinn3-tilgang-service/config.dev.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
path: /internal/health/liveness
4242
initialDelay: 10
4343
periodSeconds: 5
44-
failureThreshold: 500
44+
failureThreshold: 10
4545
observability:
4646
logging:
4747
destinations:
@@ -53,7 +53,7 @@ spec:
5353
path: /internal/health/readiness
5454
initialDelay: 10
5555
periodSeconds: 5
56-
failureThreshold: 500
56+
failureThreshold: 10
5757
prometheus:
5858
enabled: true
5959
path: /internal/metrics
@@ -62,8 +62,8 @@ spec:
6262
max: 1
6363
resources:
6464
requests:
65-
cpu: 200m
66-
memory: 1024Mi
65+
cpu: 20m
66+
memory: 800Mi
6767
limits:
6868
memory: 2048Mi
6969
env:

apps/altinn3-tilgang-service/config.prod.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ spec:
4545
path: /internal/health/liveness
4646
initialDelay: 10
4747
periodSeconds: 5
48-
failureThreshold: 500
48+
failureThreshold: 10
4949
observability:
5050
logging:
5151
destinations:
@@ -57,7 +57,7 @@ spec:
5757
path: /internal/health/readiness
5858
initialDelay: 10
5959
periodSeconds: 5
60-
failureThreshold: 500
60+
failureThreshold: 10
6161
prometheus:
6262
enabled: true
6363
path: /internal/metrics
@@ -66,8 +66,8 @@ spec:
6666
max: 1
6767
resources:
6868
requests:
69-
cpu: 200m
70-
memory: 1024Mi
69+
cpu: 20m
70+
memory: 900Mi
7171
limits:
7272
memory: 2048Mi
7373
env:

apps/app-tilgang-analyse-service/config.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ spec:
3131
- name: testnav-app-tilgang-analyse-service-db
3232
liveness:
3333
path: /internal/health/liveness
34-
initialDelay: 4
35-
periodSeconds: 5
36-
failureThreshold: 500
34+
initialDelay: 20
35+
periodSeconds: 10
36+
failureThreshold: 20
3737
observability:
3838
logging:
3939
destinations:
@@ -43,9 +43,9 @@ spec:
4343
runtime: java
4444
readiness:
4545
path: /internal/health/readiness
46-
initialDelay: 4
47-
periodSeconds: 5
48-
failureThreshold: 500
46+
initialDelay: 20
47+
periodSeconds: 10
48+
failureThreshold: 20
4949
prometheus:
5050
enabled: true
5151
path: /internal/metrics
@@ -54,8 +54,8 @@ spec:
5454
max: 1
5555
resources:
5656
requests:
57-
cpu: 200m
58-
memory: 1024Mi
57+
cpu: 20m
58+
memory: 800Mi
5959
limits:
6060
memory: 2048Mi
6161
envFrom:

apps/batch-bestilling-service/config.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
path: /internal/health/liveness
3030
initialDelay: 30
3131
periodSeconds: 30
32-
failureThreshold: 500
32+
failureThreshold: 10
3333
observability:
3434
logging:
3535
destinations:
@@ -40,7 +40,7 @@ spec:
4040
readiness:
4141
path: /internal/health/readiness
4242
initialDelay: 30
43-
failureThreshold: 500
43+
failureThreshold: 10
4444
prometheus:
4545
enabled: true
4646
path: /internal/metrics
@@ -49,8 +49,8 @@ spec:
4949
max: 1
5050
resources:
5151
requests:
52-
cpu: 200m
53-
memory: 1024Mi
52+
cpu: 20m
53+
memory: 600Mi
5454
limits:
5555
memory: 2048Mi
5656
ingresses:

0 commit comments

Comments
 (0)