-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
k6 github action testing on local server #1536
Comments
Hi, and thank you for the report! 🙏🏼 Is If not, please change the port to the one your application is exposed on. Thanks, |
Could you please check the logs for the previous step as well? 😅 |
It seems like something has changed in how actions work, as I can't get it to work anymore either. name: Main Workflow
on: [push]
jobs:
build:
name: Run k6 test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install k6
run: |
curl https://github.com/loadimpact/k6/releases/download/v0.26.2/k6-v0.26.2-linux64.tar.gz -L | tar xvz --strip-components 1
- name: Install packages
run: |
npm install
- name: Start server and run tests
run: |
npm start & npx wait-on http://localhost:3000
./k6 run test.js |
My bad, the indentation is off: name: Main Workflow
on: [push]
jobs:
build:
name: Run k6 test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install k6
run: |
curl https://github.com/loadimpact/k6/releases/download/v0.26.2/k6-v0.26.2-linux64.tar.gz -L | tar xvz --strip-components 1
- name: Install packages
run: |
npm install
- name: Start server and run tests
run: |
npm start & npx wait-on http://localhost:3000
./k6 run test.js |
Got it, it works now. Thanks! Here is the final workflow file for reference, had to add build.
|
Hai I wanna ask something, Here is my workflow: # This workflow will run an end-to-end test with k6 scripts.
name: k6_end_to_end_test
on:
pull_request:
branches: ["testing"]
jobs:
e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install k6
run: |
curl https://github.com/loadimpact/k6/releases/download/v0.26.2/k6-v0.26.2-linux64.tar.gz -L | tar xvz --strip-components 1
- name: Spin up container to run e2e
run: docker-compose -f docker-compose.test.yml up -d --build
- name: Run k6 e2e test
run: ./k6 run testing/end_to_end_test.js
- name: Remove container
run: docker-compose -f docker-compose.test.yml down The docker basically consist of my backend server. Docker step is already running well. When it comes to k6, turns out it outputs like:
Instead of running the script located on Please help anyone @m-restieri @simskij |
Hi @starRMS. it isn't really a good idea to ask questions in closed issues, espeically ones from years ago. In most cases people will just not see this at all. You are very likely not mounting the script in question inside the job so the file I would also recommend not using k6 v0.26.2 given that it is close to 4 years old. If you have more questions I do recommend our community forums |
You're absolutely right. I wasn't paying attention the version of the k6 on this issue. Thanks for the feedback, learnt a lot from this. Have a good day. |
I am trying to create a github action which uses k6 to test on a localhost server, but the server refuses to connect.
Environment
Expected Behavior
Create a github action which performs load testing on each push on a local instance (port 3000).
Actual Behavior
In the github action when trying to run the tests, all the requests refuse to connect to the server, despite working when locally tested.
Steps to Reproduce the Problem
The test script is a very basic typescript file that just calls http.get on a localhost url with some thresholds for performance. Here is the .yml file that I have been using for the github action:
Error message which appears at all of the requests:
time="2020-07-06T20:12:08Z" level=warning msg="Request Failed" error="Get http://127.0.0.1:3000/ci-test: dial tcp 127.0.0.1:3000: connect: connection refused"
The text was updated successfully, but these errors were encountered: