Skip to content

chore: move workspace apps tests to new package #7025

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

Merged
merged 3 commits into from
Apr 6, 2023
Merged

Conversation

deansheather
Copy link
Member

Moves almost every test from workspaceapps_test.go and the reconnecting pty test to a new package coderd/workspaceapps/apptest.

Closes #6905


// RunTests runs the entire workspace app test suite against deployments minted
// by the provided factory.
func RunTests(t *testing.T, factory DeploymentFactory) {
Copy link
Member

Choose a reason for hiding this comment

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

Because this is just used in workspaceapps_test.go and isn't tested independently, should it be it's own package?

I know it's large in size, but I might argue that it should be in the workspaceapps_test package instead, because that's what it's being used for anyways.

Regardless, we could call this Run instead, since test is in the package name.

Copy link
Member

@Emyrk Emyrk Apr 6, 2023

Choose a reason for hiding this comment

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

I think we can move it to workspaceapps pkg too.

Actually we cannot. You cannot import _test packages. So if we moved this to workspaceapps directory and workspaceapps_test package, then we cannot import it in our APGL and enterprise tests.

We will call this from the APGL and enterprise coderd tests.

Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

This is primarily moving code. LG, going to try and use this in enterprise now.

@Emyrk Emyrk merged commit 5398150 into main Apr 6, 2023
@Emyrk Emyrk deleted the dean/workspaceapps-test branch April 6, 2023 21:35
@github-actions github-actions bot locked and limited conversation to collaborators Apr 6, 2023
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.

Unit tests refactored into own package for APGL and Enterprise to leverage
3 participants