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 E2E tests via GitHub actions #57

Merged
merged 3 commits into from
Jul 30, 2024
Merged

Add E2E tests via GitHub actions #57

merged 3 commits into from
Jul 30, 2024

Conversation

ArangoGutierrez
Copy link
Collaborator

No description provided.

internal/logger/logger.go Outdated Show resolved Hide resolved
internal/logger/logger.go Show resolved Hide resolved
@@ -130,7 +132,7 @@ func (l *FunLogger) Loading(format string, a ...any) {
defer l.Wg.Done()
message := fmt.Sprintf(format, a...)
// if running in a non-interactive terminal, don't print the loading animation
if !isInteractiveTerminal() && isCILogs() {
if !isInteractiveTerminal() && l.isCILogs() {
Copy link
Member

Choose a reason for hiding this comment

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

Question: Is isCILogs ever used alone? Does it make sense to be queried in isInteractiveTerminal() instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, is just used for this case, you are right

tests/Makefile Outdated

.PHONY: e2e-test
e2e-test:
@if [ -z ${AWS_SECRET_ACCESS_KEY} ] || [ -z ${AWS_ACCESS_KEY_ID} ]; then \
Copy link
Member

Choose a reason for hiding this comment

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

Question: Doesn't holodeck already report an error if these are not set?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the aws-sdk pkg will complain about it, but we don't have a proper check before calling the aws-sdk pkg's.

Copy link
Member

Choose a reason for hiding this comment

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

My suggestion would be to remove this here (for simplicity) and create an issue to check these in code so that that can be reused in all consumers (device plugin, gpu operator, container toolkit) etc.

Comment on lines 89 to 90
AfterAll(func(ctx context.Context) {
// Delete the environment
Copy link
Member

Choose a reason for hiding this comment

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

Should deletion be checked in the test too? I would say that holodeck fails if it doesn't delete an environment when requested.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

By doing the deletion here, we ensure that In the case of the create test fails, ginlgo/gomega will still trigger this function, vs if we set it as a "step" after the creation bit, if create fails, the delete part won't be called because the Expect(err).ToNot(HaveOccurred()) will exit the ginkgo container

Copy link
Member

Choose a reason for hiding this comment

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

Let me put my question in another way: Assuming that create succeeds, will this raise an error if the environment is not deleted?

})

Context("and calling dryrun to validate the file", func() {
It("validate the provider", func() {
Copy link
Member

Choose a reason for hiding this comment

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

"validates"

err = client.Delete()
Expect(err).ToNot(HaveOccurred())
})
It("create the environment", func() {
Copy link
Member

Choose a reason for hiding this comment

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

"creates"

(Here I'm assuming that this is read as: "it creates the environment")

Comment on lines 45 to 46
log := logger.NewLogger()
log.CI = true
Copy link
Member

Choose a reason for hiding this comment

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

Why not have functional options here instead?

Expect(err).ToNot(HaveOccurred())

// set cache path
if opts.cachePath == "" {
Copy link
Member

Choose a reason for hiding this comment

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

Whe would these ever be unset?

}
opts.cachefile = filepath.Join(opts.cachePath, opts.cfg.Name+".yaml")

opts.cfg.Spec.Provider = v1alpha1.ProviderAWS
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be moved to after we read opts.cfg. Also, why are we overriding the provider -- should it not be defined in the spec or is the intent to use the same spec for multiple providers?

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
@ArangoGutierrez ArangoGutierrez force-pushed the e2e branch 3 times, most recently from bc936e0 to 422d0b6 Compare July 30, 2024 10:54
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
@ArangoGutierrez ArangoGutierrez merged commit 5c9c8fd into main Jul 30, 2024
3 checks passed
@ArangoGutierrez ArangoGutierrez deleted the e2e branch July 30, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants