Skip to content
This repository was archived by the owner on Feb 5, 2020. It is now read-only.

Conversation

@paulfantom
Copy link
Contributor

@paulfantom paulfantom commented Jun 7, 2018

Run basic tests in travis-ci platform. This runs same tests as Jenkins instance in "basic" mode, adds 3 types of linters (terraform, yaml, go), and builds package.
This doesn't deploy anything to AWS so it is meant to be run on every PR.

Linters:

  • tflint is used to lint terraform files in whole repository
  • yamllint is used to lint every file in examples and installer directories and subdirectories. It is permissive about line length.
  • golint recursively checks go files in installer directory. For now it is set to be in permissive mode (enforcing version is commented-out) due to some errors in libvirt.go file.

@coreosbot
Copy link

Can one of the admins verify this patch?

@paulfantom
Copy link
Contributor Author

Travis is already enabled. Working instance is here

.travis.yml Outdated
include:
- stage: Lint & Test
# Terraform lint
script: docker run -v $(pwd):/data -t wata727/tflint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll need to mirror this docker image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And maintain it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paulfantom. Yes as a rule we try not to depend on random third party containers whose maintenance and security we cannot guarantee.

Copy link
Contributor Author

@paulfantom paulfantom Jun 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enxebre @squat I agree that golang-testing and yamllint containers should be mirrored, but this one (wata727/tflint) is an official one, do we also mirror official ones?

.travis.yml Outdated
# YAML lint
- script: >
docker run -t -v $(pwd):/workdir
giantswarm/yamllint --config-data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll need to mirror this docker image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And maintain it?

.travis.yml Outdated
./examples/ ./installer/
# Go lint
#- script: "docker run -v $PWD:$PWD -w $PWD appleboy/golang-testing golint -set_exit_status installer/..."
- script: "docker run -v $PWD:$PWD -w $PWD appleboy/golang-testing golint installer/..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll need to mirror this docker image.
FYI at some point you might wanna try to revive #3115 and integrate gometalinter here somehow

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And maintain it?

.travis.yml Outdated
# Installer unit tests
- script: "chmod 0777 $PWD && docker run -v $PWD:$PWD:rw -w $PWD $BAZEL_IMG bazel test installer:cli_units --test_output=all"
- stage: Build
script: "chmod 0777 $PWD && docker run -v $PWD:$PWD:rw -w $PWD $BAZEL_IMG bazel --output_base=.cache build tarball"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need --output_base=.cache? we already have a .bazelrc file

Copy link
Contributor Author

@paulfantom paulfantom Jun 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to stay close to commands we have in README.md, but I can remove --output_base=.cache

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea behind .bazelrc is to have consistent and replicable behaviour across envs. Update readme sound good to me unless I'm missing something different when building via docker cc @squat

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants