Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Add CircleCI config#17

Merged
ddworken merged 24 commits intomasterfrom
david/circleci
Aug 15, 2019
Merged

Add CircleCI config#17
ddworken merged 24 commits intomasterfrom
david/circleci

Conversation

@ddworken
Copy link
Copy Markdown
Contributor

@ddworken ddworken commented Aug 15, 2019

Adds a circle CI config that runs unit tests, integration tests, and linters.

In order to get this to work I had to move the mount location for the integration tests from /mnt/ to /shared/. Running the mount in /mnt/ ran into the same weird disappearing bug that we had earlier but for whatever reason moving it to /shared/ works.

Comment thread .circleci/config.yml
- image: circleci/golang:1.11
steps:
- checkout
- run: "! go fmt ./... 2>&1 | read"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This trick comes from here: https://circleci.com/blog/enforce-build-standards/

Basically it is just checking whether the command outputs anything. If the command has any output, it failed.

Comment thread integrationTest.sh

# Unit tests first
go test ./... 2>&1 | grep -v 'no test files'
set +u
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So we can access $CIRCLECI which is not set if running locally.

Comment thread integrationTest.sh
go test ./... 2>&1 | grep -v 'no test files'
set +u
if [ -z "$CIRCLECI" ]; then
go test ./... 2>&1 | grep -v 'no test files'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Break the go test command out into a unit test workflow so it can run in their existing go docker image (rather than having to install go on this machine in order to run it in the same image as used for the integration tests).

@ddworken ddworken marked this pull request as ready for review August 15, 2019 15:28
@ddworken ddworken requested a review from xgess August 15, 2019 15:30
Comment thread .circleci/config.yml Outdated
Comment thread tests/tests/lib.py
# A context manager that asserts that the given function triggers expected_number of audit logs to be added to '/keybase/team/team.ssh.prod/ca.log'
# Note that fuse is not running in the container so this has to use `keybase fs read`
# A context manager that asserts that the given function triggers expected_number of audit logs to be added to the
# log at the given filename
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Copy Markdown
Contributor

@xgess xgess left a comment

Choose a reason for hiding this comment

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

lgtm

Co-Authored-By: Alex Gessner <alex.gessner@gmail.com>
@ddworken ddworken merged commit 23f3e00 into master Aug 15, 2019
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.

2 participants