Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test reachability #89

Merged
merged 75 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
52ff39e
added test to check if we can reach altinn-apis from github
dagfinno Sep 24, 2024
ca85450
added action
dagfinno Sep 24, 2024
2240336
added http-debug
dagfinno Sep 24, 2024
9d78585
added verbose
dagfinno Sep 24, 2024
406a17d
added verbose
dagfinno Sep 24, 2024
1249c58
added verbose
dagfinno Sep 24, 2024
ebd5ef7
added verbose
dagfinno Sep 24, 2024
619e786
added verbose
dagfinno Sep 24, 2024
e7dbae4
added verbose
dagfinno Sep 24, 2024
14227f5
added verbose
dagfinno Sep 24, 2024
2e53951
added verbose
dagfinno Sep 24, 2024
4fa5744
added verbose
dagfinno Sep 24, 2024
a9e3c9c
added verbose
dagfinno Sep 24, 2024
40443db
added verbose
dagfinno Sep 24, 2024
96566dd
added verbose
dagfinno Sep 24, 2024
5b842f8
added verbose
dagfinno Sep 24, 2024
13cdc13
added verbose
dagfinno Sep 24, 2024
a61db69
added verbose
dagfinno Sep 24, 2024
1088a9d
stop on fault
dagfinno Sep 24, 2024
67d8f66
stop on fault
dagfinno Sep 24, 2024
a129da8
stop on fault
dagfinno Sep 24, 2024
96e8187
stop on fault
dagfinno Sep 24, 2024
e2fe37c
stop on fault
dagfinno Sep 24, 2024
9ae861b
stop on fault
dagfinno Sep 24, 2024
dfbfb59
stop on fault
dagfinno Sep 24, 2024
f5d9a13
stop on fault
dagfinno Sep 24, 2024
9a7a9c8
stop on fault
dagfinno Sep 24, 2024
118ff3d
added data.csv
dagfinno Sep 25, 2024
778627e
No valid text file?
dagfinno Sep 25, 2024
a910047
added data.csv again
dagfinno Sep 25, 2024
3ed5014
added extra html report, increased vus and duration
dagfinno Sep 25, 2024
f7abd35
Increased setup timeout
dagfinno Sep 25, 2024
da21d2c
Shorten data file
dagfinno Sep 25, 2024
81462ed
do token gen in separate step
dagfinno Sep 25, 2024
c519acd
install xk6
dagfinno Sep 25, 2024
b5227da
added generate-tokens and newer version of golang image
dagfinno Sep 25, 2024
eb2e681
call correct k6 script in generate token step
dagfinno Sep 25, 2024
b24c127
share files between steps
dagfinno Sep 25, 2024
d9bb001
setting working directory
dagfinno Sep 25, 2024
4cb272c
fixing path
dagfinno Sep 25, 2024
0845208
cleaning up
dagfinno Sep 25, 2024
dd0079f
scaling up test
dagfinno Sep 25, 2024
06d8ed3
exporting reports to web
dagfinno Sep 25, 2024
aa2a221
full path of bash
dagfinno Sep 25, 2024
35bf8da
use sh instead of bash
dagfinno Sep 25, 2024
9dee08a
use sh instead of bash
dagfinno Sep 25, 2024
22ddf5a
usinig actions/setup-go
dagfinno Sep 26, 2024
94d74ae
usinig actions/setup-go
dagfinno Sep 26, 2024
2f00116
usinig actions/setup-go
dagfinno Sep 26, 2024
33afe17
testing self-hosted runner
dagfinno Sep 26, 2024
260353b
testing self-hosted runner
dagfinno Sep 26, 2024
847a5ef
testing self-hosted runner on windows img
dagfinno Sep 26, 2024
f64589c
refactoring
dagfinno Sep 26, 2024
1e18d0e
refactoring
dagfinno Sep 26, 2024
28bc85a
Only run one iteration when pushing
dagfinno Sep 26, 2024
59ed03c
added actions again
dagfinno Sep 26, 2024
c0482b4
added actions again
dagfinno Sep 26, 2024
3563e29
action for scheduled and ondemand execution
dagfinno Sep 26, 2024
2312425
Selecting runner
dagfinno Sep 26, 2024
d411b2c
Selecting runner
dagfinno Sep 26, 2024
3499026
Selecting runner
dagfinno Sep 26, 2024
858a2cf
changing push rules
dagfinno Sep 27, 2024
71d7fbe
checking if push filters works
dagfinno Sep 27, 2024
7724353
trying to get the runner-selection correct
dagfinno Sep 27, 2024
57d7074
trying to get the runner-selection correct
dagfinno Sep 27, 2024
ba7ce61
trying to get the runner-selection correct
dagfinno Sep 27, 2024
54f3f5d
trying to get the runner-selection correct
dagfinno Sep 27, 2024
7b0f6df
trying to get the runner-selection correct
dagfinno Sep 27, 2024
3f74e26
trying to get the runner-selection correct
dagfinno Sep 27, 2024
2dcd1f2
trying to get the runner-selection correct
dagfinno Sep 27, 2024
26b24d0
trying to get the runner-selection correct
dagfinno Sep 27, 2024
c275ec8
trying to get the runner-selection correct
dagfinno Sep 27, 2024
5f82d18
trying to get the runner-selection correct
dagfinno Sep 27, 2024
ad8955e
trying to get the runner-selection correct
dagfinno Sep 27, 2024
0d0fb41
trying to get the runner-selection correct
dagfinno Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/taxreport-loadtest-ondemand.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: taxreport loadtest ondemand

on:
workflow_dispatch:
inputs:
vus:
description: 'Number of VUS'
required: true
default: 10
type: number
duration:
description: 'Duration of test, ie 30s, 1m, 10m'
required: true
default: 1m
type: string
limit:
description: 'Limit the number of tokens to generate, 0 or less means create for every partyId/userId'
required: true
default: 10
type: number
select-runner:
description: 'Select runner to run the test'
required: true
type: choice
default: "'ubuntu-latest'"
options:
- "'ubuntu-latest'"
- "['self-hosted', 'macOS', 'X64']"

jobs:
run-test:
runs-on: ${{ fromJSON(inputs.select-runner) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: 'stable'

- name: Install xk6
run: go install go.k6.io/xk6/cmd/xk6@latest

- name: Build xk6-counter binary
working-directory: ./performance-tests/tax-report/src
run: xk6 build --with github.com/avitalique/xk6-file@latest

- name: Run k6 to generate tokens
working-directory: ./performance-tests/tax-report/src
run: ./k6 run generate-tokens.js
env:
env: ${{ secrets.YTENVIRONMENT }}
tokengenuser: ${{ secrets.TOKENGENUSER }}
tokengenuserpwd: ${{ secrets.TOKENGENPWD }}
limit: ${{ inputs.limit }}

- name: Setup K6
uses: grafana/setup-k6-action@v1

- name: Run local k6 test
uses: grafana/run-k6-action@v1
with:
path: performance-tests/tax-report/src/tax-report.js
flags: --vus=${{ inputs.vus }} --duration=${{ inputs.duration }}
env:
K6_WEB_DASHBOARD: true
K6_WEB_DASHBOARD_EXPORT: html-report.html
serviceowner: ${{ secrets.OWNER }}

- name: Upload summary html report
uses: actions/upload-artifact@v4
if: always()
with:
name: summary-html
path: summary.html
- name: Upload extended html report
uses: actions/upload-artifact@v4
if: always()
with:
name: extended-html
path: html-report.html

- name: Upload summary text report
uses: actions/upload-artifact@v4
if: always()
with:
name: summary-txt
path: stdout.txt

- name: Upload HTML report to Azure
if: always()
shell: bash
run: |
REPORT_DIR='taxreports_ondemand-${{ github.run_number }}-${{ github.run_attempt }}'
azcopy cp --recursive "*.html" "https://altinnloadtests.blob.core.windows.net/\$web/$REPORT_DIR"
echo "::Link to test results summary: title=HTML report url::https://altinnloadtests.z1.web.core.windows.net/$REPORT_DIR/summary.html"
echo "::Link to test results extended: title=HTML report url::https://altinnloadtests.z1.web.core.windows.net/$REPORT_DIR/html-report.html"
env:
AZCOPY_AUTO_LOGIN_TYPE: SPN
AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZCOPY_SPA_APPLICATION_ID }}
AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZCOPY_SPA_CLIENT_SECRET }}
AZCOPY_TENANT_ID: ${{ secrets.AZCOPY_TENANT_ID }}

52 changes: 52 additions & 0 deletions .github/workflows/taxreport-loadtest-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: taxreport loadtest smoketest

on:
push:
branches:
- '**'
paths:
- performance-tests/tax-report/**
- .github/workflows/taxreport-loadtest-push.yml

jobs:
run-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: 'stable'

- name: Install xk6
run: go install go.k6.io/xk6/cmd/xk6@latest

- name: Build xk6-counter binary
working-directory: ./performance-tests/tax-report/src
run: xk6 build --with github.com/avitalique/xk6-file@latest

- name: Run k6 to generate tokens
working-directory: ./performance-tests/tax-report/src
run: ./k6 run generate-tokens.js
env:
env: ${{ secrets.YTENVIRONMENT }}
tokengenuser: ${{ secrets.TOKENGENUSER }}
tokengenuserpwd: ${{ secrets.TOKENGENPWD }}
limit: 1

- name: Setup K6
uses: grafana/setup-k6-action@v1

- name: Run local k6 test
uses: grafana/run-k6-action@v1
with:
path: performance-tests/tax-report/src/tax-report.js
flags: --vus=1 --iterations=1
env:
K6_WEB_DASHBOARD: true
K6_WEB_DASHBOARD_EXPORT: html-report.html
serviceowner: ${{ secrets.OWNER }}


82 changes: 82 additions & 0 deletions .github/workflows/taxreport-loadtest-schedule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: taxreport loadtest scheduled

on:
schedule:
- cron: "15 4 * * *"

jobs:
run-test:
runs-on: ubuntu-latest
#runs-on: ['self-hosted', 'macOS', 'X64']
#runs-on: ['self-hosted', 'Windows', 'X64']
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup go
uses: actions/setup-go@v5
with:
go-version: 'stable'

- name: Install xk6
run: go install go.k6.io/xk6/cmd/xk6@latest

- name: Build xk6-counter binary
working-directory: ./performance-tests/tax-report/src
run: xk6 build --with github.com/avitalique/xk6-file@latest

- name: Run k6 to generate tokens
working-directory: ./performance-tests/tax-report/src
run: ./k6 run generate-tokens.js
env:
env: ${{ secrets.YTENVIRONMENT }}
tokengenuser: ${{ secrets.TOKENGENUSER }}
tokengenuserpwd: ${{ secrets.TOKENGENPWD }}

- name: Setup K6
uses: grafana/setup-k6-action@v1

- name: Run local k6 test
uses: grafana/run-k6-action@v1
with:
path: performance-tests/tax-report/src/tax-report.js
flags: --vus=40 --duration=10m
env:
K6_WEB_DASHBOARD: true
K6_WEB_DASHBOARD_EXPORT: html-report.html
serviceowner: ${{ secrets.OWNER }}

- name: Upload summary html report
uses: actions/upload-artifact@v4
if: always()
with:
name: summary-html
path: summary.html
- name: Upload extended html report
uses: actions/upload-artifact@v4
if: always()
with:
name: extended-html
path: html-report.html

- name: Upload summary text report
uses: actions/upload-artifact@v4
if: always()
with:
name: summary-txt
path: stdout.txt

- name: Upload HTML report to Azure
if: always()
shell: bash
run: |
REPORT_DIR='taxreports_scheduled-${{ github.run_number }}-${{ github.run_attempt }}'
azcopy cp --recursive "*.html" "https://altinnloadtests.blob.core.windows.net/\$web/$REPORT_DIR"
echo "::Link to test results summary: title=HTML report url::https://altinnloadtests.z1.web.core.windows.net/$REPORT_DIR/summary.html"
echo "::Link to test results extended: title=HTML report url::https://altinnloadtests.z1.web.core.windows.net/$REPORT_DIR/html-report.html"
env:
AZCOPY_AUTO_LOGIN_TYPE: SPN
AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZCOPY_SPA_APPLICATION_ID }}
AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZCOPY_SPA_CLIENT_SECRET }}
AZCOPY_TENANT_ID: ${{ secrets.AZCOPY_TENANT_ID }}

Loading
Loading