Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to run acceptance tests against Sensu-Go CI builds #1115

Merged
merged 1 commit into from Jun 27, 2019

Conversation

treydock
Copy link
Collaborator

Pull Request Checklist

Description

Add ability to run acceptance tests in Travis against Sensu-Go CI builds.

Motivation and Context

This is going to allow this module to run full acceptance test suite against unreleased versions of Sensu-Go.

@treydock
Copy link
Collaborator Author

Current travis matrix is very minimal to see if this actually works. If we wanted to test all operating systems and both Puppet 5 and Puppet 6.

@treydock
Copy link
Collaborator Author

Encrypting multiple files requires using single tar archive of all files that is then encrypted. This is why previous license was removed, now in tar archive. The script ci_build.sh is also in tar archive and that contains necessary logic to download and install CI build repos from package cloud.

@treydock treydock force-pushed the ci-builds branch 3 times, most recently from dbeec8e to 09d09ad Compare June 16, 2019 20:43
@treydock
Copy link
Collaborator Author

@ghoneycutt It seems that this PR has broken all other PRs because I had to modify the encryption key contents to support new encrypted file and travis CLI re-uses same key name so now the PRs without this change are broken.

I think what's left for this PR is to determine the matrix we want to use with CI builds. Do we want to test the full matrix with CI builds or just a select few? Also it seems allow_failures will not trigger a failure notification on slack.

@treydock
Copy link
Collaborator Author

I may have fixed the issue, not sure how but managed to get different environment variables assigned by travis CLI but had to update #1117 with newly encrypted file.

@treydock treydock changed the title WIP: Add ability to run acceptance tests against Sensu-Go CI builds Add ability to run acceptance tests against Sensu-Go CI builds Jun 23, 2019
@treydock
Copy link
Collaborator Author

Removed WIP, added CI builds for all operating systems supported

.gitignore Outdated
@@ -53,3 +53,5 @@ doc/**

# secrets
tests/sensu_license.json
tests/ci_build.sh
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this being auto generated? where?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's in tests/secrets.tar. It has the secret token for packagecloud so only exists inside encrypted tar archive. We can only encrypt one file and now require two files be encrypted and travis docs say in that case to encrypt a tar archive with files needing to be kept secret.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add instructions on how this file would be decrypted for local development

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added scripts and added those scripts to tests/README.md. The decryption of those files is only necessary if one wishes to run tests against a CI build. The absence of the secrets being decrypted and certain env variables will just test latest production package.

@treydock treydock force-pushed the ci-builds branch 5 times, most recently from 16f65d6 to ac9403f Compare June 25, 2019 20:01
#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
travis encrypt-file ${DIR}/secrets.tar.enc --decrypt --key $TRAVIS_CI_KEY --iv $TRAVIS_CI_IV
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's IV in the environment variable stand for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Part of openssl. I couldn't find in man page but googled it: https://stackoverflow.com/a/39412887. According to unofficial sources it's Initialization Vector which is part of the AES encryption.

@@ -21,3 +21,17 @@ Copy certs from vagrant instance to this repo
\cp -r /etc/puppetlabs/puppet/ssl/* /vagrant/tests/ssl/
```

# Secrets
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add some more text around what files these touch and when you might need to use them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added additional text. Also updated decrypt script to throw error if needed environment variables are not set.

fi

curl -s https://${CI_BUILD_TOKEN}:@packagecloud.io/install/repositories/sensu/ci-builds/${script} | bash 1>/dev/null 2>&1

Copy link
Collaborator

Choose a reason for hiding this comment

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

Notice your files often have a trailing newline. This should not be there. Maybe an editor plugin can help?

@ghoneycutt ghoneycutt merged commit 87702cf into master Jun 27, 2019
@ghoneycutt ghoneycutt deleted the ci-builds branch June 27, 2019 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants