First time contributing

Hello, this is the first time I contribute to k6, I want to know how to test the application, I ran docker compose up and now I wanted to know how to use a testfile in this local version? i’m kind of lost about how to execute in the correct way and run locally.

Hi @johnsmt

Welcome to the community forum :wave: and many thanks for contributing!

I am unsure if you are contributing to k6 (or other projects). If that is the case, have you followed the section k6/CONTRIBUTING.md at master · grafana/k6 · GitHub, especially the development setup?

You mention docker-compose, are you fixing something that requires the docker-compose.yml?

If you can provide more details on your contribution (is there an open issue you are working on) and where you are stuck, we’ll happily help :bowing_woman:

Cheers!

hi @eyeveebee, i’m contributing to k6, but i think I expressed myself badly, I’ll try again.

I read all the k6/CONTRIBUTING.md at master, but i’m still confuse about how to test the application after i do a modification, let me explain:

When i download k6 from the official website, i can just run a script by
k6 run script.js
but, when a clone the github k6 version, how do i run it, how can i run a test in my local version?

It’s my first time too using linters, but i understand that the use is for check for bugs or typos, right?

Taking advantage of this space, I would like to ask a question about the test suit, when I run it more than once, the tests appear in cache, even when making changes to the code, how do I get them to run again?

i’m not fixing something that requires the docker-compose.yml?, at least i think, i was just trying run it.

1 Like

Hey @johnsmt,

Welcome to the support forum :tada:

I’m a maintainer of k6, and I will try to support you to the best of my abilities :crossed_fingers:

Once you have downloaded the repository, you can run the development version by using the go run command:

go run go.k6.io/k6 run myscript.js

Regarding linters, you are correct. We rely on the golangci-lint linter tool to indeed ensure our code follows our standards, and to catch bugs and potential common issues before we build and run the tool. Note that k6 has a .golangci.yaml file at the root of the repository with a configuration specific to k6, you can verify your changes by passing those linter rules by using the make lint command/directive at the root of the repository by.

Regarding testing and bypassing the Go test cache, to enforce tests being built and run every time from scratch, I believe you can pass the --count=0 flag to the go test command.

I hope this helps unblock you, let me know if that was helpful and if you need further support :crossed_fingers: :bowing_man:

2 Likes