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

Implement EC install CLI command integration test #1420

Conversation

sgalsaleh
Copy link
Member

@sgalsaleh sgalsaleh commented Oct 29, 2024

What this PR does / why we need it:

Implements a framework for running CLI dry run tests.

Which issue(s) this PR fixes:

SC-114608

Does this PR require a test?

Yes

Does this PR require a release note?

NONE

Does this PR require documentation?

NONE

Example output

$ time make dryrun-tests
[2024-10-30 15:11:46] 🔨 [INFO] Building test container...
[2024-10-30 15:11:46] 🚀 [INFO] Starting test: TestDefaultInstallation
[2024-10-30 15:11:46] 🚀 [INFO] Starting test: TestCustomDataDir
[2024-10-30 15:11:46] 🚀 [INFO] Starting test: TestCustomPortsInstallation
[2024-10-30 15:11:47] ⏳ [INFO] Waiting for tests to complete...
[2024-10-30 15:12:01] ✅ [INFO] TestDefaultInstallation passed
[2024-10-30 15:12:01] ✅ [INFO] TestCustomDataDir passed
[2024-10-30 15:12:01] ✅ [INFO] TestCustomPortsInstallation passed
[2024-10-30 15:12:02] 🎉 [SUCCESS] All tests passed successfully!
make dryrun-tests  0.23s user 0.17s system 2% cpu 15.624 total

@sgalsaleh sgalsaleh changed the title Salah/sc 113890/discovery prioritize two highest value integration Implement EC install CLI command integration test Oct 29, 2024
@sgalsaleh sgalsaleh force-pushed the salah/sc-113890/discovery-prioritize-two-highest-value-integration branch 2 times, most recently from 5399fc5 to 4235ad1 Compare October 30, 2024 22:00
tests/dryrun/install_test.go Outdated Show resolved Hide resolved
tests/dryrun/install_test.go Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Oct 30, 2024

This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID.

Online Installer:

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci/appver-dev-32ea98a" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Airgap Installer (may take a few minutes before the airgap bundle is built):

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci-airgap/appver-dev-32ea98a?airgap=true" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Happy debugging!

}
}

func assertMetrics(t *testing.T, actual []dryruntypes.Metric, expected map[string]func(string)) {
Copy link
Member

Choose a reason for hiding this comment

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

expected maybe should be a slice so you can assert order

tests/dryrun/util.go Outdated Show resolved Hide resolved
tests/dryrun/util.go Outdated Show resolved Hide resolved
//go:embed assets/install-release.yaml
var releaseData string

func dryrunInstall(t *testing.T, args ...string) dryruntypes.DryRun {
Copy link
Member

@emosbaugh emosbaugh Oct 31, 2024

Choose a reason for hiding this comment

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

it would be nice to export functions that are intended to be used in testing to make this package more self documenting including this, readK0sConfig, and the assert functions

Copy link
Member Author

Choose a reason for hiding this comment

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

this is only intended to be used for dryrun tests though

@sgalsaleh sgalsaleh marked this pull request as ready for review October 31, 2024 17:54
@sgalsaleh sgalsaleh force-pushed the salah/sc-113890/discovery-prioritize-two-highest-value-integration branch from e850f10 to f7e31dc Compare October 31, 2024 20:46
emosbaugh
emosbaugh previously approved these changes Oct 31, 2024
emosbaugh
emosbaugh previously approved these changes Oct 31, 2024
@sgalsaleh sgalsaleh force-pushed the salah/sc-113890/discovery-prioritize-two-highest-value-integration branch from f3e2f09 to d73f4b3 Compare October 31, 2024 21:16
@sgalsaleh sgalsaleh merged commit 1efad9b into main Nov 1, 2024
59 checks passed
@sgalsaleh sgalsaleh deleted the salah/sc-113890/discovery-prioritize-two-highest-value-integration branch November 1, 2024 00:18
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.

2 participants