Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #187 from Netflix/test-doc-changes
Browse files Browse the repository at this point in the history
Linting docs, test and build changes
  • Loading branch information
rgulewich committed Oct 5, 2018
2 parents 304b145 + fedfe49 commit 616e642
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,5 @@ $(GOVENDOR):
.PHONY: testdeps
testdeps: $(GOVENDOR)
$(GOVENDOR) install +local
# Fail if gometalinter is not present in $PATH:
# Fail if gometalinter is not present in PATH:
which gometalinter
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ If you want to build a dpkg, without Docker, once the code is checked out, you c
make build-standalone
```

## Linting
Linting is done via the [gometalinter](https://github.com/alecthomas/gometalinter) package, which runs various linters. In order to ensure
consistent versions of linters, install version 2.0.11 as per the instructions in "Initial setup steps" above.

To run lint checks:
```sh-session
# Lint all files:
make validate
# Lint only the files that have changed in git:
make validate FAST=1
# Run lint checks inside a docker container:
make validate-docker
```

## Testing
### Local Testing
Expand Down
2 changes: 1 addition & 1 deletion hack/builder/titus-executor-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if [[ $num_debs -ne 1 ]]; then
exit 1
fi

filename=${outdir}/*.deb
filename=$(ls -t ${outdir}/*.deb | grep -v latest | head -n 1)

# TODO: only run the linter on the file above
# see: nebula/src/main/groovy/netflix/nebula/ospackage/NebulaOsPackageDebRepositoryPublish.groovy
Expand Down
10 changes: 9 additions & 1 deletion hack/tests-with-dind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ set -eu -o pipefail
# ... technically, this runs docker-on-systemd-in-docker
# - tests run against the docker daemon above
# - this script tries to automatically teardown the systemd container running in background
#
# Environment variables that this script pays attention to:
# - BUILD_ID: Jenkins build ID
# - DEBUG: Run the agent in debug mode?
# - GO_PKG: Can be used to override the working dir under GOPATH
# - JOB_NAME: Jenkins job name
# - TEST_TIMEOUT: timeout for `go test`
# - TEST_FLAGS: flags passed to `go test`

# portable uuidgen
random_uuid=$(od -N 16 -x /dev/urandom | head -1 | awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}')
Expand Down Expand Up @@ -51,7 +59,7 @@ docker run --privileged --security-opt seccomp=unconfined -v /sys/fs/cgroup:/sys
log "Running integration tests against the $titus_agent_name daemon"
# --privileged is needed here since we are reading FDs from a unix socket
docker exec --privileged -e DEBUG=${debug} -e SHORT_CIRCUIT_QUITELITE=true -e GOPATH=${GOPATH} -e GOCACHE=off "$titus_agent_name" \
go test -timeout 3m ${TEST_FLAGS:-} \
go test -timeout ${TEST_TIMEOUT:-3m} ${TEST_FLAGS:-} \
-covermode=count -coverprofile=coverage-standalone.out \
-coverpkg=github.com/Netflix/... ./executor/mock/standalone/... -standalone=true 2>&1 | tee test-standalone.log

Expand Down

0 comments on commit 616e642

Please sign in to comment.