-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Reintroduce test suite for install script #46718
base: master
Are you sure you want to change the base?
Conversation
The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with |
assets/install-scripts/install-teleport-tests/docker-compose.yml
Outdated
Show resolved
Hide resolved
test_teleport | ||
test_tctl | ||
test_tsh | ||
test_tbot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we also test that fdpass-teleport
is installed? That's probably a later version than 15.0.0 but I note the install script does mention it if it exists.
Although now I think on it more, I think it might be better to remove the tests for tctl
, tsh
and tbot
- the installed does nothing specific to install those - it just installs a teleport release asset so we should only be checking that it has done that, not that the release asset contains the correct binaries - that test belongs somewhere else in the release process perhaps. Testing for the upgrader for cloud is correct as the install script has special logic for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. Changed.
1. Edit the `command` field of the service definition to include the following: | ||
|
||
```yaml | ||
bash /install.sh 15.0.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice that some of the tests have 15.1.0 instead of 15.0.0 - what determines the version that goes here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I don't think I was thinking about this. When I first added the test environment in the private repo, 15 was the latest major version, and beyond that, I think it was pretty arbitrary.
What would be the most maintainable way to set a version here? Have run-all-tests.sh
retrieve the latest release version and pass it to the install.sh
script on each container using a container environment variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds reasonable and removes a maintenance burden on managing the multiple version numbers currently here.
assets/install-scripts/install-teleport-tests/docker-compose.yml
Outdated
Show resolved
Hide resolved
The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with |
ff46484
to
89a10ce
Compare
The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with |
89a10ce
to
c3cc1f6
Compare
c3cc1f6
to
88b00b7
Compare
@camscale Following up to see if I addressed your feedback. Thanks! |
88b00b7
to
bb4046b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine as is, but would be better with the auto-versioning. That could be a follow-up PR if you prefer.
1. Edit the `command` field of the service definition to include the following: | ||
|
||
```yaml | ||
bash /install.sh 15.0.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds reasonable and removes a maintenance burden on managing the multiple version numbers currently here.
bash -c 'apt-get update; | ||
apt-get install -y curl; | ||
sed -E -i "s/ID_LIKE=.*$/ID_LIKE=\"ubuntu debian\"/" /etc/os-release; | ||
bash /install.sh 15.0.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: for consistency with the rest of this file, this should have oss
as an arg to the install script (I know it's the default, just that the other oss install has it explicitly)
bb4046b
to
e7f3edd
Compare
e7f3edd
to
b7f6d7c
Compare
The original location of the Teleport installation script included a test suite based on Docker Compose. Add the test suite to the new location along with the original GitHub Actions workflow that ran on changes to the installation script.
- Rename the workflow - Fix an error message - Fix unused variable - docker-compose.yml -> docker-compose.yaml - Remove obsolete `version` attribute from docker-compose.yaml - Refactor case statement in run-test.sh - Remove unnecessary test assertions. The test doesn't need to check that all expected binaries are in a teleport package.
This way, we can guarantee that the release version we are installing in tests available. Use `gh` to get the latest release number and pass the TELEPORT_VERSION shell variable to test containers.
Get tests to pass by not specifying a Teleport version if using apt-get with Teleport Cloud. This is because the version specified by the `TELEPORT_VERSION` variable may not be available in the `stable/cloud` channel. Also remove redundant `/etc/os-release` sourcing.
b7f6d7c
to
7bafb74
Compare
The original location of the Teleport installation script included a test suite based on Docker Compose. Add the test suite to the new location along with the original GitHub Actions workflow that ran on changes to the installation script.