create a project wrapper to run e2e tests - #1432
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
e3bd797 to
4e83529
Compare
|
|
||
| // checkRequiredEnvironmentVariables verifies if the required environment variables for the STACKIT service are set. | ||
| func checkRequiredEnvironmentVariables() error { | ||
| requiredVars := []string{ |
There was a problem hiding this comment.
Doc comment (lines 17-22) says STACKIT_SERVICE_ACCOUNT_TOKEN is required
| } | ||
| defer func() { | ||
| log.Printf("Deleting portal project %s.", stackitProjectID) | ||
| cleanupErr := deletePortalProject(context.Background(), stackitClient, stackitProjectID) |
There was a problem hiding this comment.
If the delete API call hangs, the process blocks indefinitely. We should at least use a context with timeout.
| log.Printf("Deleting portal project %s.", stackitProjectID) | ||
| cleanupErr := deletePortalProject(context.Background(), stackitClient, stackitProjectID) | ||
| if cleanupErr != nil { | ||
| log.Printf("Deleting protal project %s failed: %v", stackitProjectID, cleanupErr) |
There was a problem hiding this comment.
| log.Printf("Deleting protal project %s failed: %v", stackitProjectID, cleanupErr) | |
| log.Printf("Deleting portal project %s failed: %v", stackitProjectID, cleanupErr) |
| cmderr := cmd.Run() | ||
|
|
||
| if cmderr != nil { | ||
| return fmt.Errorf("integration tests failed: %v", cmderr) |
There was a problem hiding this comment.
| return fmt.Errorf("integration tests failed: %v", cmderr) | |
| return fmt.Errorf("integration tests failed: %w", cmderr) |
How to categorize this PR?
/kind enhancement
What this PR does / why we need it:
This change adds a small project wrapper tool that allows to run e2e tests with a STACKIT project.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Breaking changes: