Skip to content

Cleanup ephemeral groups in integration tests#368

Merged
pietern merged 2 commits intomainfrom
cleanup-groups
Apr 14, 2023
Merged

Cleanup ephemeral groups in integration tests#368
pietern merged 2 commits intomainfrom
cleanup-groups

Conversation

@pietern
Copy link
Copy Markdown
Contributor

@pietern pietern commented Apr 13, 2023

Changes

These tests left groups around that had to be removed manually/separately.

Tests

Manually ran changed integration tests.

Copy link
Copy Markdown
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

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

LGTM! Is this a good use of the defer keyword in golang?

@pietern
Copy link
Copy Markdown
Contributor Author

pietern commented Apr 13, 2023

@mgyucht It could be if tests didn't use panic for control flow (i.e. t.FailNow() or t.Skip()).

Defer works if you return from a function under normal circumstances, not when unwinding a panic.

@pietern
Copy link
Copy Markdown
Contributor Author

pietern commented Apr 13, 2023

@mgyucht Turns out my understanding is wrong, defer should still work with panic.

See https://go.dev/blog/defer-panic-and-recover.

@pietern
Copy link
Copy Markdown
Contributor Author

pietern commented Apr 13, 2023

@mgyucht The difference is that t.Cleanup is called on test completion and defer when returning from a function. So if you have a bunch of helper functions to construct state that you want to keep around for the duration of a test, t.Cleanup will do the trick, where defer wouldn't.

@pietern pietern merged commit c4dcc5a into main Apr 14, 2023
@pietern pietern deleted the cleanup-groups branch April 14, 2023 06:36
@nfx nfx mentioned this pull request Apr 20, 2023
nfx added a commit that referenced this pull request Apr 20, 2023
# Version changelog

## 0.8.0

* Added more code generation utilities
([#369](#369)).
* Body logger for non-JSON payload as well
([#365](#365)).
* Cleanup ephemeral groups in integration tests
([#368](#368)).
* Fixed external entity generation
([#372](#372)).
* Skip loading default profile if host is already configured
([#363](#363)).
* Update debug messages in config loader to display correct path
([#362](#362)).

Dependency updates:

* Bump golang.org/x/oauth2 from 0.6.0 to 0.7.0
([#364](#364)).
* Bump google.golang.org/api from 0.115.0 to 0.116.0
([#361](#361)).
* Bump google.golang.org/api from 0.116.0 to 0.118.0
([#367](#367)).
 
API changes:

 * Moved `clusterpolicies` APIs to `compute` package.
 * Moved `clusters` APIs to `compute` package.
 * Moved `commands` APIs to `compute` package.
 * Moved `globalinitscripts` APIs to `compute` package.
 * Moved `instancepools` APIs to `compute` package.
 * Moved `scim` APIs to `iam` package.
 * Moved `permissions` APIs to `iam` package.
 * Moved `ipaccesslists` APIs to `settings` package.
 * Moved `tokenmanagement` APIs to `settings` package.
 * Moved `tokens` APIs to `settings` package.
 * Moved `workspaceconf` APIs to `settings` package.
 * Moved `gitcredentials` APIs to `workspace` package.
 * Moved `repos` APIs to `workspace` package.
 * Moved `secrets` APIs to `workspace` package.
 * Split `unitcatalog` package to `catalog` and `sharing`.
 * Renamed `mlflow` package to `ml`.
 * Renamed `dbfs` package to `files`.
 * Renamed `deployment` package to `provisioning`.
 * Renamed `endpoints` package to `serving`.
 * Renamed `clusters.List` type to `compute.ListClustersRequest`.
 * Renamed `jobs.ListRuns` type to `jobs.ListRunsRequest`.
 * Renamed `jobs.ExportRun` type to `jobs.ExportRunRequest`.
* Renamed `clusterpolicies.List` type to
`compute.ListClusterPoliciesRequest`.
 * Renamed `jobs.List` type to `jobs.ListJobsRequest`.
* Renamed `permissions.GetPermissionLevels` type to
`iam.GetPermissionLevelsRequest`.
* Renamed `pipelines.ListPipelineEvents` type to
`pipelines.ListPipelineEventsRequest`.
* Renamed `pipelines.ListPipelines` type to
`pipelines.ListPipelinesRequest`.
* Renamed `workspaceconf.GetStatus` type to `settings.GetStatusRequest`.
 * Renamed `repos.List` type to `workspace.ListReposRequest`.
* Renamed `tokenmanagement.List` type to
`settings.ListTokenManagementRequest`.
 * Renamed `workspace.Export` type to `workspace.ExportRequest`.
 * Renamed `workspace.List` type to `workspace.ListWorkspaceRequest`.
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.

3 participants