Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/block-hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Oct 7, 2020
2 parents 372f140 + ef717e1 commit 887f583
Show file tree
Hide file tree
Showing 614 changed files with 60,515 additions and 44,712 deletions.
45 changes: 16 additions & 29 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,22 @@ jobs:
deps:
docker:
- image: circleci/golang:1.14
environment:
GOPATH: /home/circleci/.go_workspace
working_directory: /home/circleci/.go_workspace/src/github.com/loadimpact/k6
steps:
- checkout
- run:
name: Check dependencies
command: |
go version
export PATH="$GOPATH/bin:$PATH"
mkdir -p "$GOPATH/bin"
curl --fail https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep version
dep status
case $(dep ensure 2>&1 | head -n 1) in Warning*) false ;; esac
dep check
test -z "$(go mod vendor && git status --porcelain)"
go mod verify
lint:
docker:
- image: circleci/golang:1.14
environment:
GOPATH: /home/circleci/.go_workspace
GOLANGCI_VERSION: v1.25.0
GOLANGCI_VERSION: v1.30.0
GO111MODULE: 'on'
working_directory: /home/circleci/.go_workspace/src/github.com/loadimpact/k6
steps:
# Workaround for custom env vars not available in cache keys
Expand All @@ -36,24 +28,24 @@ jobs:
name: Restore golangci-lint cache
key: golangci-lint-{{ arch }}-{{ checksum "/tmp/.golangci.version" }}-{{ .Environment.CACHE_VERSION }}
paths:
- /home/circleci/.go_workspace/bin/golangci-lint
- /go/bin/golangci-lint
- run:
name: Install golangci-lint
command: |
export PATH="$GOPATH/bin:$PATH"
command -v golangci-lint && exit
GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@$GOLANGCI_VERSION
go get github.com/golangci/golangci-lint/cmd/golangci-lint@$GOLANGCI_VERSION
- save_cache:
name: Save golangci-lint cache
key: golangci-lint-{{ arch }}-{{ checksum "/tmp/.golangci.version" }}-{{ .Environment.CACHE_VERSION }}
paths:
- /home/circleci/.go_workspace/bin/golangci-lint
- /go/bin/golangci-lint
- checkout
- run:
name: Run golangci-lint
command: |
export PATH="$GOPATH/bin:$PATH"
golangci-lint run --out-format=tab --new-from-rev origin/master ./...
BASEREV=$(git merge-base HEAD origin/master)
echo "Base revision: $BASEREV"
golangci-lint run --out-format=tab --new-from-rev "$BASEREV" ./...
test:
Expand Down Expand Up @@ -83,17 +75,16 @@ jobs:
rm -f *.coverage
bash <(curl --fail -s https://codecov.io/bash)
#TODO: when we officially move to Go 1.15, re-enable test-prev-golang with 1.14

test-prev-golang:
test-next-golang:
docker:
- image: circleci/golang:1.13
environment:
GOPATH: /home/circleci/.go_workspace
- image: circleci/golang:1.15
working_directory: /home/circleci/.go_workspace/src/github.com/loadimpact/k6
steps:
- checkout
- run:
name: Run tests with previous Go version
name: Run tests with next Go version
command: |
go version
export GOMAXPROCS=2
Expand All @@ -103,17 +94,13 @@ jobs:
build-docker-images:
docker:
- image: circleci/golang:1.14
environment:
GOPATH: /home/circleci/.go_workspace
working_directory: /home/circleci/.go_workspace/src/github.com/loadimpact/k6
steps:
- checkout
- setup_remote_docker:
version: 17.11.0-ce
- setup_remote_docker
- run:
name: Setup repo and docker
command: |
git submodule update --init
docker info
echo "{\"https://index.docker.io/v1/\":{\"auth\":\"$DOCKER_AUTH\",\"email\":\"$DOCKER_EMAIL\"}}" >~/.dockercfg
- run:
Expand Down Expand Up @@ -202,7 +189,7 @@ workflows:
filters:
tags:
only: /.*/
- test-prev-golang:
- test-next-golang:
filters:
tags:
only: /.*/
Expand Down
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
(ノ◕ヮ◕)ノ*:・゚✧
Thank you for your interest in contributing to the k6 project!
Before you get started, we'd kindly like to ask you to read our:
- Contribution guidelines at https://github.com/loadimpact/k6/blob/master/CONTRIBUTING.md
- Code of Conduct at https://github.com/loadimpact/k6/blob/master/CODE_OF_CONDUCT.md
Out of respect for your time, please start a discussion regarding any bigger contributions either
in a GitHub Issue, in the community forums or in the #contributors channel of the k6 slack before you
get started on the implementation.
If you've already done all of that, you're more than welcome to proceed with your pull request.
Thank you again for your contribution! 🙏🏼
-->
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,21 @@ test.debug

.vscode
*.sublime-workspace
*.log
.idea
.vagrant

*.DS_Store

/vendor/**/.editorconfig
/vendor/**/*.jpg
/vendor/**/*.json
/vendor/**/.*.json
/vendor/**/Makefile
/vendor/**/*.png
/vendor/**/*.tmpl
/vendor/**/*.txt
!/vendor/modules.txt
/vendor/**/*.y*ml
/vendor/**/.*.y*ml
/vendor/github.com/dlclark/regexp2/testoutput1
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ linters-settings:
linters:
enable-all: true
disable:
- gci
- gochecknoinits
- godot
- godox
- gomodguard
- testpackage
- wsl
- gomnd
- goerr113 # most of the errors here are meant for humans
- nlreturn
fast: false
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ That said, "how do I..."-type questions are often more suited for Slack.
Contributing code
-----------------

If you'd like to contribute code to k6, this is the basic procedure. Make sure to follow the [style guide](#style-guide) described below!
If you'd like to contribute code to k6, this is the basic procedure. Make sure to follow the [style guide](#style-guide) described below.

1. Find an issue you'd like to fix. If there is none already, or you'd like to add a feature, please open one and we can talk about how to do it.

Remember, there's more to software development than code; if it's not properly planned, stuff gets messy real fast.
1. Find an issue you'd like to fix. If there is none already, or you'd like to add a feature, please open one and we can talk about how to do it. Out of respect for your time, please start a discussion regarding any bigger contributions either in a GitHub Issue, in the community forums or in the `#contributors` channel of the k6 slack **before** you get started on the implementation.


Remember, there's more to software development than code; if it's not properly planned, stuff gets messy real fast.

2. Create a fork and open a feature branch - `feature/my-cool-feature` is the classic way to name these, but it really doesn't matter.

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM golang:1.13-alpine as builder
FROM golang:1.14-alpine as builder
WORKDIR $GOPATH/src/github.com/loadimpact/k6
ADD . .
RUN apk --no-cache add git
RUN CGO_ENABLED=0 go install -a -trimpath -ldflags "-s -w -X github.com/loadimpact/k6/lib/consts.VersionDetails=$(date -u +"%FT%T%z")/$(git describe --always --long --dirty)"

FROM alpine:3.10
FROM alpine:3.11
RUN apk add --no-cache ca-certificates && \
adduser -D -u 12345 -g 12345 k6
COPY --from=builder /go/bin/k6 /usr/bin/k6
Expand Down
Loading

0 comments on commit 887f583

Please sign in to comment.