Skip to content

Pass the FS to k6deps #4841

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

Closed
wants to merge 139 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
9ac8ced
Fix scenario shortcut multiple usage errors
inancgumus Jun 5, 2025
d3400a6
Use consistent error messages
inancgumus Jun 5, 2025
5e7c8dd
Use CODECOV_TOKEN from Vault instead of Github
inancgumus Jun 2, 2025
d9170f6
Tidy up test.yml vault steps
inancgumus Jun 5, 2025
a36a31b
Add a count method in the injected script
ankur22 May 19, 2025
a31cf63
Add count method on ElementHandle
ankur22 May 19, 2025
0eb10e5
Add count on Frame
ankur22 May 19, 2025
261d39c
Add count to the locator
ankur22 May 19, 2025
d161821
Add count to the locator mapping file
ankur22 May 19, 2025
8ac0ee6
Add a test for locator.count
ankur22 May 19, 2025
2e73028
Add Count to TestMappings
ankur22 May 19, 2025
bf6a2de
Fix user in dockerfile
ankur22 Jun 5, 2025
5a19bb5
Update Dockerfile
ankur22 Jun 5, 2025
563bc46
build(deps): bump the googles group across 1 directory with 3 updates…
dependabot[bot] Jun 6, 2025
249a4fe
build(deps): bump the otel group with 6 updates
dependabot[bot] Jun 6, 2025
c8ec2c0
build(deps): bump github.com/evanw/esbuild from 0.25.4 to 0.25.5 (#4821)
dependabot[bot] Jun 9, 2025
1fb95fc
build(deps): bump the golangx group with 5 updates
dependabot[bot] Jun 9, 2025
79b04f5
Prevent testcov running for forks
inancgumus Jun 6, 2025
ee27d09
Skip running codecov upload on public forks
inancgumus Jun 9, 2025
ab73b18
Fix nth parse in injected script
ankur22 Jun 4, 2025
11dd1e2
Add detection of nth selector type
ankur22 Jun 4, 2025
b55dcd6
Add Nth in locator
ankur22 Jun 4, 2025
e889229
Add the mapping of the nth method for locator
ankur22 Jun 4, 2025
2ba4839
Add test for locator.nth
ankur22 Jun 4, 2025
2794351
Add locator.first
ankur22 Jun 4, 2025
d522ae5
Add locator.last
ankur22 Jun 4, 2025
8342507
Ignore lint issue
ankur22 Jun 4, 2025
bf431a3
Use string concat instead of sprintf
ankur22 Jun 5, 2025
c12984d
Fix fill method in injection script
ankur22 May 22, 2025
418c9e2
Add a test for the Fill fix
ankur22 May 23, 2025
c5b88f4
Add react js files to avoid flaky tests due to...
ankur22 Jun 4, 2025
8fc1160
k6/browser: skip fmt.Sprintf when creating injectedScript
mstoykov Apr 25, 2025
53a032c
k6/browser: preallocate response/request headers
mstoykov Apr 25, 2025
82b6dae
k6/browser: Bump ws read buffer which was previously makign it read a…
mstoykov Apr 25, 2025
8af1614
Prevent running testcov on forks (#4847)
inancgumus Jun 12, 2025
0641c73
Run CI/CD tests also on ARM (#4848)
nadiamoe Jun 13, 2025
5d4cce5
Retire experimental/webcrypto (#4851)
codebien Jun 16, 2025
1ee9bda
k6/browser: Unparallize TestElementHandleQueryAll
mstoykov Jun 16, 2025
ff9e365
k6/browser: always close the browser unless skipped
mstoykov Jun 16, 2025
c50611e
k6/browser: do not import k6/http in tests
mstoykov Jun 16, 2025
df23c37
k6/browser: drop startIteration use testBrowser
mstoykov Jun 16, 2025
aa0131c
Add a workaround for getting frame width height
ankur22 Jun 11, 2025
af992dd
Use the workaround to get width height from util
ankur22 Jun 11, 2025
5460663
Update errors for clickablePoint flow
ankur22 Jun 16, 2025
15450dd
Fix order of groups in the full summary (#4807)
the-it Jun 17, 2025
3e3551c
Switch to Vault for winsign
inancgumus Jun 9, 2025
d3d4605
Switch to Vault for pgp
inancgumus Jun 9, 2025
6e81b32
Switch to Vault for aws
inancgumus Jun 9, 2025
bb0027e
Switch to Vault for CF
inancgumus Jun 9, 2025
530b3fa
Switch to Vault for S3 bucket
inancgumus Jun 9, 2025
36682b7
Update k6 packager s3cmd and aws
inancgumus Jun 11, 2025
245f589
Remove k6 packager docker compose version
inancgumus Jun 11, 2025
5cf234a
Prevent k6 packager s3cmd to set ACLs
inancgumus Jun 13, 2025
34c2dc9
Update sobek and goja respectfully
mstoykov Jun 17, 2025
2e5aeff
Update alpine in Dockerfile to 3.22
ankur22 Jun 19, 2025
b480971
Update the console.log to actually work
ankur22 Jun 18, 2025
bc29957
Disable ocsp test so that GHA CI works
mstoykov Jun 20, 2025
76e2bca
Revert "Update sobek and goja respectfully"
mstoykov Jun 23, 2025
ac98ba8
Disable usage reporting in CI jobs
mstoykov Jun 25, 2025
c43d730
Bump k6 version to v1.1.0 (#4874)
joanlopez Jun 25, 2025
0e3fb95
Release notes for v1.1.0 (#4860)
joanlopez Jun 25, 2025
5e0faab
Skip running winsign on public forks
inancgumus Jun 26, 2025
1ce8053
Browser: Support string-labels in locator.selectOption (#4897)
AgnesToulet Jul 7, 2025
95ff2cc
build(deps): bump github.com/grafana/xk6-redis from 0.3.3 to 0.3.4 (#…
dependabot[bot] Jul 8, 2025
5ec5645
Add a role based selector engine
ankur22 May 2, 2025
1dd7484
Add getByRole options
ankur22 May 20, 2025
ec7ece2
Add getByRole in Frame
ankur22 May 20, 2025
e422e35
Add getByRole in Page
ankur22 May 20, 2025
767b17d
Add getByRole in page mapping
ankur22 May 20, 2025
fe9a31c
Update to internal:role
ankur22 May 20, 2025
f923747
Add tests for getByRole for edge cases
ankur22 Jun 9, 2025
0d819c7
Add tests on getByRole with explicit roles in DOM
ankur22 Jun 9, 2025
f99075c
Add tests for getByRole with implicit elements
ankur22 Jun 9, 2025
a37fb85
Add getByRole in page mapping test
ankur22 Jun 9, 2025
bfc8d10
Update tests so they work on windows
ankur22 Jun 10, 2025
18ddef1
Update test file to ignore build on windows
ankur22 Jun 10, 2025
15b71ec
Update from " to '
ankur22 Jun 10, 2025
95afd69
Fix test after change from " to '
ankur22 Jun 10, 2025
533be09
Update comment and log for GetByRole
ankur22 Jun 16, 2025
dcba8ec
Refactor GetByRole Locator builder
ankur22 Jun 16, 2025
df01809
Refactor to use generics in test
ankur22 Jun 16, 2025
94f2e4f
Fix for linter
ankur22 Jun 16, 2025
cf76687
Move parsing logic to mapping for getByRole
ankur22 Jun 17, 2025
fc12347
Use new parsing function for getByRole
ankur22 Jun 17, 2025
6af0618
Remove old getByRole parser
ankur22 Jun 17, 2025
5872339
Move ptr and rename it to toPtr
ankur22 Jun 17, 2025
aa2f62b
Fix linter error due to nil error
ankur22 Jun 18, 2025
faff94a
Add tests for exact option for getByRole
ankur22 Jul 7, 2025
a1a54e0
xk6-dashboard upgraded to v0.7.9
szkiba Jul 9, 2025
5e2329c
Merge pull request #4909 from grafana/4908-update-xk6-dashboard-to-v078
szkiba Jul 10, 2025
8cf8ca6
fix: Avoid NaN (division by 0) on Checks summary (#4878)
Fernando-hub527 Jul 10, 2025
6e0955e
Fix page.url() to work with cached url
ankur22 Jul 10, 2025
21316be
Add k6 Studio mention in README (#4923)
Llandy3d Jul 14, 2025
4fc6aad
dependabot: try to allow all otel depedancies with template
mstoykov Jul 14, 2025
cedf946
build(deps): bump the golangx group with 6 updates
dependabot[bot] Jul 14, 2025
f8a2824
build(deps): bump github.com/evanw/esbuild from 0.25.5 to 0.25.6
dependabot[bot] Jul 14, 2025
536f9e1
build(deps): bump github.com/andybalholm/brotli from 1.1.1 to 1.2.0
dependabot[bot] Jul 15, 2025
20b553c
Refine console.log to properly print errors (#4916)
joanlopez Jul 15, 2025
12d9cc0
Update the logging around request abort
ankur22 Jul 15, 2025
583e086
Fix tests for logging change
ankur22 Jul 15, 2025
6208e89
Update log to debug on "Invalid InterceptionId"
ankur22 Jul 15, 2025
fd54bd6
build(deps): bump the otel group across 1 directory with 11 updates
dependabot[bot] Jul 15, 2025
15b8192
xk6-dashboard updated to v0.7.10
szkiba Jul 16, 2025
4cab4d5
Browser: Add locator.all (#4899)
AgnesToulet Jul 17, 2025
e64c0e8
Merge branch 'master' into 4938-update-xk6-dashboard-to-v0.7.10
szkiba Jul 18, 2025
da1430b
Merge pull request #4939 from grafana/4938-update-xk6-dashboard-to-v0…
szkiba Jul 18, 2025
8f8fffa
Add a new type for use when working with the...
ankur22 Jul 10, 2025
66943cb
Add regex engine matcher
ankur22 Jul 10, 2025
81e5973
Update waitForNavigation options parser
ankur22 Jul 15, 2025
a5ec63c
Add a urlMatcher which does some validation
ankur22 Jul 10, 2025
5aff0d6
Update waitForNavigation to take JSRegexChecker
ankur22 Jul 10, 2025
01cd1f2
Update logging in waitForNavigation
ankur22 Jul 10, 2025
c0779be
Update to create and use the matcher
ankur22 Jul 10, 2025
303e0d5
Update the page.waitForNavigate mapping
ankur22 Jul 10, 2025
bd417a1
Update the frame.waitForNavigate mapping
ankur22 Jul 10, 2025
0bb3d93
Add a test for waitForNavigation with url
ankur22 Jul 10, 2025
a3221c7
Add error propagation if matcher fails with error
ankur22 Jul 16, 2025
a101a27
Add test for regex failure case
ankur22 Jul 16, 2025
105277b
Add a condition to prevent test from running on..
ankur22 Jul 16, 2025
9cf2033
k6packager: Adjust versions of dependencies (s3cmd, aws) (#4879)
joanlopez Jul 18, 2025
31a6f8e
build(deps): bump debian in /packaging
dependabot[bot] Jul 18, 2025
7a5b33e
chore: move to enumer versions that are working
mstoykov Jul 18, 2025
9bb8f77
k6/html: move wrongly moved gen/gen_elements.go back out of internal
mstoykov Jul 18, 2025
d64b142
cloudapi: fix proto definitions after move to internal
mstoykov Jul 18, 2025
9ea333c
output/json: regenerate easyjson after move to internal
mstoykov Jul 18, 2025
e8f572e
Add Dependabot rule for the main Dockerfile
codebien Jul 18, 2025
b5fb22b
Use alpine 3.22 for the builder
codebien Jul 18, 2025
dea6d51
ci/deps: fail on go generate failing + refactor
mstoykov Jul 21, 2025
d4d0c2a
initial integration
pablochacin May 22, 2025
4cc25dc
refactor provisioning into an interface
pablochacin May 20, 2025
9846eaf
use loadsurce to read source file
pablochacin May 22, 2025
34c9fcb
handle stdin
pablochacin May 22, 2025
96bfa9a
attend review comments
pablochacin Jun 17, 2025
a8582f0
fix comment
pablochacin Jun 18, 2025
4918704
add fsext bridge
pablochacin Jun 19, 2025
4234f7e
pass bridge to ksdeps
pablochacin Jun 19, 2025
70282cf
address review comments
pablochacin Jun 19, 2025
0e1b95d
move fs bridge to launcher
pablochacin Jul 15, 2025
6360295
add missing import
pablochacin Jul 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 14 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,17 @@ updates:
- dependency-name: "github.com/mattn/go-colorable"
- dependency-name: "github.com/mstoykov/k6-taskqueue-lib"
- dependency-name: "github.com/stretchr/testify"
- dependency-name: "go.opentelemetry.io/otel"
- dependency-name: "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
- dependency-name: "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
- dependency-name: "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
- dependency-name: "go.opentelemetry.io/otel/sdk"
- dependency-name: "go.opentelemetry.io/otel/trace"
- dependency-name: "go.opentelemetry.io/*"

- package-ecosystem: "docker"
directory: "/"
schedule:
# We don't update immediately. We usually wait for `vX.Y.1` to be out.
interval: "quarterly"

# Update k6packager dependencies
- package-ecosystem: "docker"
directory: "/packaging"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
12 changes: 10 additions & 2 deletions .github/workflows/browser_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
go: [stable, tip]
platform: [ubuntu-latest, windows-latest, macos-latest]
platform: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
Expand All @@ -35,6 +35,7 @@ jobs:
with:
go-version: 1.x
- name: Install Go tip
if: matrix.go == 'tip'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -44,6 +45,12 @@ jobs:
echo "GOPATH=$HOME/go" >> "$GITHUB_ENV"
echo "$HOME/go/bin" >> "$GITHUB_PATH"
echo "$HOME/sdk/gotip/bin" >> "$GITHUB_PATH"
- name: Install chromium
# This is only needed on arm images, chromium comes preinstalled on amd64 runner images.
if: contains(matrix.platform, 'arm')
run: |
sudo apt update && sudo apt install chromium-browser
chromium --version
- name: Build k6
run: |
which go
Expand All @@ -54,10 +61,11 @@ jobs:
- name: Run E2E tests
run: |
set -x
if [ "$RUNNER_OS" == "Linux" ]; then
if [ "$RUNNER_OS" == "Linux" ] && [ "$RUNNER_ARCH" == "X64" ]; then
export K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome
fi
export K6_BROWSER_HEADLESS=true
export K6_NO_USAGE_REPORT=true
for f in examples/browser/*.js; do
if [ "$f" == "examples/browser/hosts.js" ] && [ "$RUNNER_OS" == "Windows" ]; then
echo "skipping $f on Windows"
Expand Down
54 changes: 39 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ jobs:
permissions:
contents: read
actions: read
id-token: write # Required for Vault

runs-on: windows-latest
defaults:
Expand Down Expand Up @@ -272,27 +273,34 @@ jobs:
cd .\packaging
candle.exe -arch x64 "-dVERSION=$env:VERSION" k6.wxs
light.exe -ext WixUIExtension k6.wixobj

# GH secrets are unavailable when building from project forks, so this
# will fail for external PRs, even if we wanted to do it. And we don't.
# We are only going to sign packages that are built from master or a
# version tag, or manually triggered dev builds, so we have enough
# assurance that package signing works, but don't sign every PR build.
- if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' }}
uses: grafana/shared-workflows/actions/get-vault-secrets@get-vault-secrets/v1.2.1
with:
repo_secrets: |
WIN_SIGN_CERT=winsign:WIN_SIGN_CERT
WIN_SIGN_PASS=winsign:WIN_SIGN_PASS

- name: Sign Windows binary and .msi package
# GH secrets are unavailable when building from project forks, so this
# will fail for external PRs, even if we wanted to do it. And we don't.
# We are only going to sign packages that are built from master or a
# version tag, or manually triggered dev builds, so we have enough
# assurance that package signing works, but don't sign every PR build.
if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' }}
if: ${{ env.WIN_SIGN_CERT != '' && env.WIN_SIGN_PASS != '' }}
run: |
# Convert base64 certificate to PFX
$bytes = [Convert]::FromBase64String("${{ secrets.WIN_SIGN_CERT }}")
$bytes = [Convert]::FromBase64String("${{ env.WIN_SIGN_CERT }}")
[IO.File]::WriteAllBytes("k6.pfx", $bytes)

# Get the latest signtool executable
$SignTool = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits\10\bin" -Recurse -Filter signtool.exe | Where-Object { $_.DirectoryName -like "*\x64" } | Sort-Object -Descending | Select-Object -First 1

# Sign the Windows binary
& $SignTool sign /f k6.pfx /p "${{ secrets.WIN_SIGN_PASS }}" /tr "http://timestamp.digicert.com" /td sha256 /fd sha256 "packaging\k6.exe"
& $SignTool sign /f k6.pfx /p "${{ env.WIN_SIGN_PASS }}" /tr "http://timestamp.digicert.com" /td sha256 /fd sha256 "packaging\k6.exe"

# Sign the MSI package
& $SignTool sign /f k6.pfx /p "${{ secrets.WIN_SIGN_PASS }}" /tr "http://timestamp.digicert.com" /td sha256 /fd sha256 "packaging\k6.msi"
& $SignTool sign /f k6.pfx /p "${{ env.WIN_SIGN_PASS }}" /tr "http://timestamp.digicert.com" /td sha256 /fd sha256 "packaging\k6.msi"

# Cleanup signing artifacts
del k6.pfx
Expand Down Expand Up @@ -363,6 +371,7 @@ jobs:
actions: read
contents: read
packages: read
id-token: write # Required for Vault
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -384,16 +393,31 @@ jobs:
mv "dist/k6-$VERSION-windows-amd64.msi" "dist/k6-$VERSION-amd64.msi"
mv "dist/k6-$VERSION-linux-amd64.rpm" "dist/k6-$VERSION-amd64.rpm"
mv "dist/k6-$VERSION-linux-amd64.deb" "dist/k6-$VERSION-amd64.deb"
- uses: grafana/shared-workflows/actions/get-vault-secrets@get-vault-secrets/v1.2.1
with:
repo_secrets: |
IAM_ROLE_ARN=deploy:packager-iam-role
AWS_CF_DISTRIBUTION=cloudfront:AWS_CF_DISTRIBUTION
PGP_SIGN_KEY_PASSPHRASE=pgp:PGP_SIGN_KEY_PASSPHRASE
PGP_SIGN_KEY=pgp:PGP_SIGN_KEY
S3_BUCKET=s3:AWS_S3_BUCKET
- uses: grafana/shared-workflows/actions/aws-auth@aws-auth/v1.0.2
with:
aws-region: "us-east-2"
role-arn: ${{ env.IAM_ROLE_ARN }}
set-creds-in-environment: true
- name: Setup docker compose environment
run: |
cat > packaging/.env <<EOF
AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION=us-east-1
AWS_CF_DISTRIBUTION="${{ secrets.AWS_CF_DISTRIBUTION }}"
PGP_SIGN_KEY_PASSPHRASE=${{ secrets.PGP_SIGN_KEY_PASSPHRASE }}
AWS_ACCESS_KEY_ID=${{ env.AWS_ACCESS_KEY_ID }}
AWS_CF_DISTRIBUTION="${{ env.AWS_CF_DISTRIBUTION }}"
AWS_DEFAULT_REGION=us-east-2
AWS_SECRET_ACCESS_KEY=${{ env.AWS_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN=${{ env.AWS_SESSION_TOKEN }}
PGP_SIGN_KEY_PASSPHRASE=${{ env.PGP_SIGN_KEY_PASSPHRASE }}
S3_BUCKET=${{ env.S3_BUCKET }}
EOF
echo "${{ secrets.PGP_SIGN_KEY }}" > packaging/sign-key.gpg
echo "${{ env.PGP_SIGN_KEY }}" > packaging/sign-key.gpg
- name: Publish packages
env:
GITHUB_ACTOR: ${{ github.actor }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ jobs:
go mod verify
- name: Check code generation
run: |
go install github.com/alvaroloes/enumer@v1.1.2
go install github.com/mailru/easyjson/easyjson@v0.7.7
test -z "$(go generate ./... && git status --porcelain)"
make generate
test -z "$(git status --porcelain | tee >(cat 1>&2))"

lint:
runs-on: ubuntu-latest
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/packager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ jobs:
publish-packager:
runs-on: ubuntu-latest
env:
VERSION: 0.0.3
AWSCLI_VERSION: 2.1.36
S3CMD_VERSION: 2.1.0
VERSION: 0.0.4
DOCKER_IMAGE_ID: ghcr.io/grafana/k6packager
GITHUB_ACTOR: ${{ github.actor }}
permissions:
Expand Down
37 changes: 33 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
go-version: [1.23.x]
platform: [ubuntu-22.04, windows-latest]
platform: [ubuntu-22.04, ubuntu-24.04-arm, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
Expand All @@ -35,6 +35,12 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Install chromium
# This is only needed on arm images, chromium comes preinstalled on amd64 runner images.
if: contains(matrix.platform, 'arm')
run: |
sudo apt update && sudo apt install chromium-browser
chromium --version
- name: Run tests
run: |
set -x
Expand All @@ -53,7 +59,7 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-22.04, windows-latest]
platform: [ubuntu-22.04, ubuntu-24.04-arm, windows-latest]
runs-on: ${{ matrix.platform }}
continue-on-error: true
steps:
Expand All @@ -73,6 +79,12 @@ jobs:
echo "GOPATH=$HOME/go" >> "$GITHUB_ENV"
echo "$HOME/go/bin" >> "$GITHUB_PATH"
echo "$HOME/sdk/gotip/bin" >> "$GITHUB_PATH"
- name: Install chromium
# This is only needed on arm images, chromium comes preinstalled on amd64 runner images.
if: contains(matrix.platform, 'arm')
run: |
sudo apt update && sudo apt install chromium-browser
chromium --version
- name: Run tests
run: |
set -x
Expand All @@ -93,7 +105,10 @@ jobs:
fail-fast: false
matrix:
go-version: [1.24.x]
platform: [ubuntu-22.04, windows-latest]
platform: [ubuntu-22.04, ubuntu-24.04-arm, windows-latest]
permissions: # required for Vault
id-token: write
contents: read
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
Expand All @@ -105,6 +120,12 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Install chromium
# This is only needed on arm images, chromium comes preinstalled on amd64 runner images.
if: contains(matrix.platform, 'arm')
run: |
sudo apt update && sudo apt install chromium-browser
chromium --version
- name: Run tests with code coverage
run: |
go version
Expand All @@ -127,11 +148,19 @@ jobs:
done
grep -h -v "^mode:" *.coverage >> coverage.txt
rm -f *.coverage
# Sets CODECOV_TOKEN as an environment variable for the next step
- name: Get Codecov token
# Skip this step if the PR is from a fork, as we can't fetch secrets for forks.
if: github.event.pull_request.head.repo.full_name == github.repository
uses: grafana/shared-workflows/actions/get-vault-secrets@get-vault-secrets/v1.2.1
with:
repo_secrets: |
CODECOV_TOKEN=CODECOV_TOKEN:CODECOV_TOKEN
- name: Upload coverage to Codecov
if: github.event.pull_request.head.repo.full_name == github.repository
env:
CODECOV_BASH_VERSION: 1.0.1
CODECOV_BASH_SHA512SUM: d075b412a362a9a2b7aedfec3b8b9a9a927b3b99e98c7c15a2b76ef09862aeb005e91d76a5fd71b511141496d0fd23d1b42095f722ebcd509d768fba030f159e
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
if [[ "${{ matrix.platform }}" == macos* ]]; then
shopt -s expand_aliases
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/xk6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fail-fast: false
matrix:
go: [stable, tip]
platform: [ubuntu-latest, windows-latest, macos-latest]
platform: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
Expand Down Expand Up @@ -79,6 +79,7 @@ jobs:
--output ./k6ext \
--with github.com/grafana/xk6-js-test="$(pwd)/xk6-js-test" \
--with github.com/grafana/xk6-output-test="$(pwd)/xk6-output-test"
export K6_NO_USAGE_REPORT=true
./k6ext version
./k6ext run --out outputtest=output-results.txt xk6-test.js

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/internal/js/tc39/TestTC39
/internal/js/modules/k6/experimental/streams/tests/wpt
/internal/js/modules/k6/webcrypto/tests/wpt/
/.protoc

.vscode
*.sublime-workspace
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM --platform=$BUILDPLATFORM golang:1.24-alpine3.21 as builder
FROM --platform=$BUILDPLATFORM golang:1.24-alpine3.22 as builder
WORKDIR $GOPATH/src/go.k6.io/k6
COPY . .
ARG TARGETOS TARGETARCH
RUN apk --no-cache add git=~2
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -trimpath -o /usr/bin/k6

# Runtime stage
FROM alpine:3.21 as release
FROM alpine:3.22 as release

RUN adduser -D -u 12345 -g 12345 k6
COPY --from=builder /usr/bin/k6 /usr/bin/k6

USER k6
USER 12345
WORKDIR /home/k6

ENTRYPOINT ["k6"]
Expand All @@ -24,7 +24,7 @@ USER root
COPY --from=release /usr/bin/k6 /usr/bin/k6
RUN apk --no-cache add chromium-swiftshader

USER k6
USER 12345

ENV CHROME_BIN=/usr/bin/chromium-browser
ENV CHROME_PATH=/usr/lib/chromium/
Expand Down
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
MAKEFLAGS += --silent
GOLANGCI_LINT_VERSION = $(shell head -n 1 .golangci.yml | tr -d '\# ')
PROTOC_VERSION := 21.12
PROTOC_ARCHIVE := protoc-$(PROTOC_VERSION)-linux-x86_64.zip
PROTOC_DOWNLOAD_URL := https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOC_VERSION)/$(PROTOC_ARCHIVE)

proto-dependencies:
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
@if [ "$$(uname)" != "Linux" ]; then \
echo "Error: Can't install protoc on your OS, please install protoc-$(PROTOC_VERSION) manually." >&2; \
exit 1; \
fi
@echo "Downloading $(PROTOC_ARCHIVE)"
curl --show-error --fail --no-location -LO $(PROTOC_DOWNLOAD_URL)
unzip -o $(PROTOC_ARCHIVE) -d ./.protoc
rm $(PROTOC_ARCHIVE)

generate-tools-installs: proto-dependencies
go install github.com/mstoykov/enumer@v0.0.1 # TODO figure out if we shouldn't move to a different fork
go install mvdan.cc/gofumpt@v0.8.0 # TODO maybe just use go fmt for this case
go install github.com/mailru/easyjson/easyjson@v0.7.7 # TODO remove this in the future

generate: generate-tools-installs
PATH="$(PWD)/.protoc/bin:$(PATH)" go generate ./...


all: clean format tests build

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ export default function () {

You can run scripts like this on the CLI, or in your CI, or across a Kubernetes cluster.

> [!NOTE]
> Don't want to write code ?
>
> We got you! Meet [k6 Studio](https://github.com/grafana/k6-studio), a desktop application made to help you generate k6 scripts without having to touch code!

## Documentation

The docs cover all aspects of using k6. Some highlights include:
Expand Down
11 changes: 0 additions & 11 deletions cmd/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,5 @@ import (
func Execute() {
gs := state.NewGlobalState(context.Background())

if gs.Flags.BinaryProvisioning {
internalcmd.NewLauncher(gs).Launch()
return
}

// If Binary Provisioning is not enabled, continue with the regular k6 execution path

// TODO: this is temporary defensive programming
// The Launcher has already the support for this specific execution path, but we decided to play safe here.
// After the v1.0 release, we want to fully delegate this control to the Launcher.
gs.Logger.Debug("Binary Provisioning feature is disabled.")
internalcmd.ExecuteWithGlobalState(gs)
}
Loading