Skip to content

Conversation

@shreyas-goenka
Copy link
Contributor

@shreyas-goenka shreyas-goenka commented Dec 30, 2024

Changes

This PR adds back debugging functionality that was lost during migration to internal.Main as an entry point for integration tests.

The PR that caused the regression: #2009. Specifically the addition of internal.Main as the entrypoint for all integration tests.

Tests

Manually, by trying to debug a test.

@denik
Copy link
Contributor

denik commented Dec 30, 2024

This PR adds back debugging functionality that was lost during migration to internal.Main as an entry point for integration tests.

Could you link the PR that caused the issue explicitly here?

Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

@shreyas-goenka The entry point always was acc.WorkspaceTest.

Tests that didn't use that entry point were never debuggable.

Instead of applying this everywhere, I recommend using the acc.WorkspaceTest wrapper in test where it is applicable to make easy debugging possible.

@shreyas-goenka
Copy link
Contributor Author

@pietern The problem I am trying to workaround is the main() entry point requiring CLOUD_ENV to be set.

	value := os.Getenv("CLOUD_ENV")
	if value == "" {
		fmt.Println("CLOUD_ENV is not set, skipping integration tests")
		return
	}

Since the main entry point runs before acc.WorkspaceTest, the function does not have a chance to load the debug env in the first place.

@shreyas-goenka shreyas-goenka requested a review from pietern January 2, 2025 08:45
@shreyas-goenka
Copy link
Contributor Author

@denik The PR that caused the regression: #2009. Specifically the addition of internal.Main as the entrypoint for all integration tests.

Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

Ah, I see.

Then please include the isInDebug-equivalent check to the main function. Then nothing else needs to change and we don't inadvertently load a workspace profile for an account-level test, or mix UC and non-UC.

@github-actions
Copy link

github-actions bot commented Jan 2, 2025

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 2053
  • Commit SHA: 12b5071850b3a5b153b9686665600231f5ed0902

Checks will be approved automatically on success.

@shreyas-goenka shreyas-goenka requested a review from pietern January 2, 2025 09:26
@pietern pietern changed the title Enable debugging integration tests in VSCode Enable debugging integration tests in VS Code Jan 2, 2025
@pietern
Copy link
Contributor

pietern commented Jan 2, 2025

@shreyas-goenka Please include a backlink to the PR that added this to the PR summary for posterity.

@shreyas-goenka shreyas-goenka merged commit 890c57e into main Jan 2, 2025
8 of 9 checks passed
@shreyas-goenka shreyas-goenka deleted the enable-debugging-integration-tests branch January 2, 2025 11:22
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.

4 participants