10000 chore: remove local storage based optin/optout by jaaydenh · Pull Request #18344 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore: remove local storage based optin/optout #18344

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 11 commits into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: fix tests
  • Loading branch information
jaaydenh committed Jun 12, 2025
commit 8d64a3778e5bf7c4a546b47114435c05bf139784
1 change: 1 addition & 0 deletions coderd/parameters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ func TestDynamicParametersWithTerraformValues(t *testing.T) {
Value: "GO",
},
}
request.EnableDynamicParameters = true
})
coderdtest.AwaitWorkspaceBuildJobCompleted(t, setup.client, wrk.LatestBuild.ID)

Expand Down
2 changes: 1 addition & 1 deletion coderd/templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ func TestPatchTemplateMeta(t *testing.T) {
user := coderdtest.CreateFirstUser(t, client)
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
require.False(t, template.UseClassicParameterFlow, "default is false")
require.True(t, template.UseClassicParameterFlow, "default is true")

bTrue := true
bFalse := false
Expand Down
20 changes: 0 additions & 20 deletions coderd/wsbuilder/wsbuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func TestBuilder_NoOptions(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(nil),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand Down Expand Up @@ -114,7 +113,6 @@ func TestBuilder_Initiator(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(nil),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand Down Expand Up @@ -161,7 +159,6 @@ func TestBuilder_Baggage(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(nil),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand Down Expand Up @@ -200,7 +197,6 @@ func TestBuilder_Reason(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(nil),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand Down Expand Up @@ -239,7 +235,6 @@ func TestBuilder_ActiveVersion(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withActiveVersion(nil),
withLastBuildNotFound,
withTemplateVersionVariables(activeVersionID, nil),
Expand Down Expand Up @@ -343,7 +338,6 @@ func TestWorkspaceBuildWithTags(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(richParameters),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, templateVersionVariables),
Expand Down Expand Up @@ -439,7 +433,6 @@ func TestWorkspaceBuildWithRichParameters(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(richParameters),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand Down Expand Up @@ -487,7 +480,6 @@ func TestWorkspaceBuildWithRichParameters(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(richParameters),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand Down Expand Up @@ -541,7 +533,6 @@ func TestWorkspaceBuildWithRichParameters(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(richParameters),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand Down Expand Up @@ -574,7 +565,6 @@ func TestWorkspaceBuildWithRichParameters(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withInactiveVersion(richParameters),
withLastBuildFound,
withTemplateVersionVariables(inactiveVersionID, nil),
Expand Down Expand Up @@ -627,7 +617,6 @@ func TestWorkspaceBuildWithRichParameters(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withActiveVersion(version2params),
withLastBuildFound,
withTemplateVersionVariables(activeVersionID, nil),
Expand Down Expand Up @@ -691,7 +680,6 @@ func TestWorkspaceBuildWithRichParameters(t *testing.T) {
mDB := expectDB(t,
B85D // Inputs
withTemplate,
withTerraformValuesErrNoRows,
withActiveVersion(version2params),
withLastBuildFound,
withTemplateVersionVariables(activeVersionID, nil),
Expand Down Expand Up @@ -753,7 +741,6 @@ func TestWorkspaceBuildWithRichParameters(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withActiveVersion(version2params),
withLastBuildFound,
withTemplateVersionVariables(activeVersionID, nil),
Expand Down Expand Up @@ -801,7 +788,6 @@ func TestWorkspaceBuildWithPreset(t *testing.T) {
mDB := expectDB(t,
// Inputs
withTemplate,
withTerraformValuesErrNoRows,
withActiveVersion(nil),
// building workspaces using presets with different combinations of parameters
// is tested at the API layer, in TestWorkspace. Here, it is sufficient to
Expand Down Expand Up @@ -916,12 +902,6 @@ func withTemplate(mTx *dbmock.MockStore) {
}, nil)
}

func withTerraformValuesErrNoRows(mTx *dbmock.MockStore) {
mTx.EXPECT().GetTemplateVersionTerraformValues(gomock.Any(), gomock.Any()).
Times(1).
Return(database.TemplateVersionTerraformValue{}, sql.ErrNoRows)
}

// withInTx runs the given functions on the same db mock.
func withInTx(mTx *dbmock.MockStore) {
mTx.EXPECT().InTx(gomock.Any(), gomock.Any()).Times(1).DoAndReturn(
Expand Down
0