Skip to content

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Aug 23, 2024

Allows mutating deployment values.
Also modifies the check on DisableOwnerWorkspaceExec to be a warn-log, as this caught me out for a while when testing something. Unfortunately I couldn't find a way to detect inside a test if t.Parallel() had already been called.

@johnstcn johnstcn self-assigned this Aug 23, 2024
options.DeploymentValues.DisableOwnerWorkspaceExec = false
// This value is not safe to run in parallel.
if options.DeploymentValues.DisableOwnerWorkspaceExec {
t.Logf("WARNING: DisableOwnerWorkspaceExec is set, this is not safe in parallel tests!")
Copy link
Member

Choose a reason for hiding this comment

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

It'd be cool if we could actually check if parallel has been set (or will be set!), maybe we should implement out own testing.TB... 😆

Copy link
Member Author

Choose a reason for hiding this comment

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

We could possibly set a dummy environment variable; this should cause t.Parallel() to panic.

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

Nice 👍

@johnstcn johnstcn merged commit 99e103e into main Aug 23, 2024
31 checks passed
@johnstcn johnstcn deleted the cj/coderdtest/mutate-deployment-values branch August 23, 2024 11:15
@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy