Skip to content

Commit

Permalink
Merge pull request #2 from domsolutions/pipeline-tests
Browse files Browse the repository at this point in the history
cron pipeline, build ext and run
  • Loading branch information
domsolutions authored Jan 6, 2024
2 parents 9306900 + 3801f80 commit cd089f8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
35 changes: 27 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go
name: E2E

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
schedule:
- cron: '15 9 * * *'

defaults:
run:
shell: bash

jobs:

Expand All @@ -16,9 +20,8 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: true
max-parallel: 1

steps:
- uses: actions/checkout@v3
Expand All @@ -34,5 +37,21 @@ jobs:
- name: Test
run: go test -v ./...

- name: Build
run: go build ./...
- name: Install k6
run: go install go.k6.io/k6@latest

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

- name: Build extension
run: |
which go
go version
GOPRIVATE="go.k6.io/k6" xk6 build latest \
--output ./k6ext \
--with github.com/domsolutions/xk6-fasthttp=.
./k6ext version
- name: Run E2E test
run: ./k6ext run -u 1 -i 1 examples/json.js
3 changes: 2 additions & 1 deletion examples/json.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Client } from "k6/x/fasthttp"
import { Request, Client, checkstatus } from "k6/x/fasthttp"

const client = new Client();

Expand All @@ -8,5 +8,6 @@ let req = new Request("https://dummyjson.com/products/1");
// Simulated user behavior
export default function () {
let res = client.get(req);
checkstatus(200, res);
console.log(res.json())
}

0 comments on commit cd089f8

Please sign in to comment.