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

Fix context usage in E2E #679

Open
ramizpolic opened this issue Apr 25, 2024 · 1 comment
Open

Fix context usage in E2E #679

ramizpolic opened this issue Apr 25, 2024 · 1 comment

Comments

@ramizpolic
Copy link
Member

          Okay so, we have a problem with passing contexts to these functions from the parent.

The issue why we can't use the ctx variable here from the afterSetup function's parameter is because if you follow up the call chain then that ctx is the setupCtx variable in the beforeSuit function, see here: https://github.com/openclarity/vmclarity/blob/main/e2e/suite_test.go#L68

That context ends when the beforeSuit function runs to completion and after that the context is not available, but with the current solution we want to use that context in actual tests (because we want to have an open SSH connection to VMClarity control plane while the tests are running).

This is not going to work, we have to rework how we pass context from ginkgo's test suite creation to the actual test environments, but I think that's out of the scope of this PR.

The situation is the same here in your previous comment - https://github.com/openclarity/vmclarity/pull/1601/files/de050880ac466a03a92bbf25a6497d4bde060beb#diff-7be911ff144b8813d4374c3f85695689dd505e9ace576d90e7f0f2b7a071b421R327 - the context that we pass to the iamService is cancelled when the beforeSuit ends, but we want to use this context in the TearDown where we want to undelete the 2 roles.

Originally posted by @adamtagscherer in openclarity/vmclarity#1601 (comment)

@github-actions github-actions bot added the stale Denotes an issue or PR that has become stale and will be auto-closed. label Jun 30, 2024
@paralta paralta removed the stale Denotes an issue or PR that has become stale and will be auto-closed. label Jul 1, 2024
@openclarity openclarity deleted a comment from github-actions bot Jul 1, 2024
@ramizpolic ramizpolic transferred this issue from openclarity/vmclarity Aug 8, 2024
Copy link

Thank you for your contribution! This issue has been automatically marked as stale because it has no recent activity in the last 60 days. It will be closed in 14 days, if no further activity occurs. If this issue is still relevant, please leave a comment to let us know, and the stale label will be automatically removed.

@github-actions github-actions bot added the stale Denotes an issue or PR that has become stale and will be auto-closed. label Oct 13, 2024
@ramizpolic ramizpolic removed the stale Denotes an issue or PR that has become stale and will be auto-closed. label Oct 17, 2024
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

No branches or pull requests

2 participants