Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf598da

Browse files
committed
Merge branch 'refactor-site-use-new-tasks-data-model-and-endpoints' ofhttps://github.com/coder/coder into refactor-site-use-new-tasks-data-model-and-endpoints
2 parentseea8ed5 +6d13866 commitdf598da

File tree

47 files changed

+648
-424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+648
-424
lines changed

‎.github/workflows/traiage.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ on:
1313
template_name:
1414
description:"Coder template to use for workspace"
1515
required:true
16-
default:"traiage"
16+
default:"coder"
1717
type:string
1818
template_preset:
1919
description:"Template preset to use"
2020
required:true
21-
default:"Default"
21+
default:"none"
2222
type:string
2323
prefix:
2424
description:"Prefix for workspace name"
@@ -66,8 +66,8 @@ jobs:
6666
GITHUB_EVENT_USER_ID:${{ github.event.sender.id }}
6767
GITHUB_EVENT_USER_LOGIN:${{ github.event.sender.login }}
6868
INPUTS_ISSUE_URL:${{ inputs.issue_url }}
69-
INPUTS_TEMPLATE_NAME:${{ inputs.template_name || 'traiage' }}
70-
INPUTS_TEMPLATE_PRESET:${{ inputs.template_preset || 'Default'}}
69+
INPUTS_TEMPLATE_NAME:${{ inputs.template_name || 'coder' }}
70+
INPUTS_TEMPLATE_PRESET:${{ inputs.template_preset || 'none'}}
7171
INPUTS_PREFIX:${{ inputs.prefix || 'traiage' }}
7272
GH_TOKEN:${{ github.token }}
7373
run:|

‎cli/delete_test.go‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ func TestDelete(t *testing.T) {
185185

186186
t.Run("WarnNoProvisioners",func(t*testing.T) {
187187
t.Parallel()
188-
if!dbtestutil.WillUsePostgres() {
189-
t.Skip("this test requires postgres")
190-
}
191188

192189
store,ps,db:=dbtestutil.NewDBWithSQLDB(t)
193190
client,closeDaemon:=coderdtest.NewWithProvisionerCloser(t,&coderdtest.Options{
@@ -228,9 +225,6 @@ func TestDelete(t *testing.T) {
228225

229226
t.Run("Prebuilt workspace delete permissions",func(t*testing.T) {
230227
t.Parallel()
231-
if!dbtestutil.WillUsePostgres() {
232-
t.Skip("this test requires postgres")
233-
}
234228

235229
// Setup
236230
db,pb:=dbtestutil.NewDB(t,dbtestutil.WithDumpOnFailure())

‎cli/exp_scaletest_dynamicparameters.go‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const (
2727
func (r*RootCmd)scaletestDynamicParameters()*serpent.Command {
2828
var (
2929
templateNamestring
30+
provisionerTags []string
3031
numEvalsint64
3132
tracingFlags=&scaletestTracingFlags{}
3233
prometheusFlags=&scaletestPrometheusFlags{}
@@ -56,6 +57,11 @@ func (r *RootCmd) scaletestDynamicParameters() *serpent.Command {
5657
returnxerrors.Errorf("template cannot be empty")
5758
}
5859

60+
tags,err:=ParseProvisionerTags(provisionerTags)
61+
iferr!=nil {
62+
returnerr
63+
}
64+
5965
org,err:=orgContext.Selected(inv,client)
6066
iferr!=nil {
6167
returnerr
@@ -99,7 +105,7 @@ func (r *RootCmd) scaletestDynamicParameters() *serpent.Command {
99105
}()
100106
tracer:=tracerProvider.Tracer(scaletestTracerName)
101107

102-
partitions,err:=dynamicparameters.SetupPartitions(ctx,client,org.ID,templateName,numEvals,logger)
108+
partitions,err:=dynamicparameters.SetupPartitions(ctx,client,org.ID,templateName,tags,numEvals,logger)
103109
iferr!=nil {
104110
returnxerrors.Errorf("setup dynamic parameters partitions: %w",err)
105111
}
@@ -160,6 +166,11 @@ func (r *RootCmd) scaletestDynamicParameters() *serpent.Command {
160166
Default:"100",
161167
Value:serpent.Int64Of(&numEvals),
162168
},
169+
{
170+
Flag:"provisioner-tag",
171+
Description:"Specify a set of tags to target provisioner daemons.",
172+
Value:serpent.StringArrayOf(&provisionerTags),
173+
},
163174
}
164175
orgContext.AttachOptions(cmd)
165176
output.attach(&cmd.Options)

‎cli/server_regenerate_vapid_keypair_test.go‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ import (
1717

1818
funcTestRegenerateVapidKeypair(t*testing.T) {
1919
t.Parallel()
20-
if!dbtestutil.WillUsePostgres() {
21-
t.Skip("this test is only supported on postgres")
22-
}
2320

2421
t.Run("NoExistingVAPIDKeys",func(t*testing.T) {
2522
t.Parallel()

‎cli/server_test.go‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,6 @@ func TestServer(t *testing.T) {
348348

349349
runGitHubProviderTest:=func(t*testing.T,tctestCase) {
350350
t.Parallel()
351-
if!dbtestutil.WillUsePostgres() {
352-
t.Skip("test requires postgres")
353-
}
354351

355352
ctx,cancelFunc:=context.WithCancel(testutil.Context(t,testutil.WaitLong))
356353
defercancelFunc()
@@ -2142,10 +2139,6 @@ func TestServerYAMLConfig(t *testing.T) {
21422139
funcTestConnectToPostgres(t*testing.T) {
21432140
t.Parallel()
21442141

2145-
if!dbtestutil.WillUsePostgres() {
2146-
t.Skip("this test does not make sense without postgres")
2147-
}
2148-
21492142
t.Run("Migrate",func(t*testing.T) {
21502143
t.Parallel()
21512144

@@ -2256,10 +2249,6 @@ type runServerOpts struct {
22562249
funcTestServer_TelemetryDisabled_FinalReport(t*testing.T) {
22572250
t.Parallel()
22582251

2259-
if!dbtestutil.WillUsePostgres() {
2260-
t.Skip("this test requires postgres")
2261-
}
2262-
22632252
telemetryServerURL,deployment,snapshot:=mockTelemetryServer(t)
22642253
dbConnURL,err:=dbtestutil.Open(t)
22652254
require.NoError(t,err)

‎coderd/aitasks_test.go‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"github.com/coder/coder/v2/coderd/database/dbauthz"
2424
"github.com/coder/coder/v2/coderd/database/dbfake"
2525
"github.com/coder/coder/v2/coderd/database/dbgen"
26-
"github.com/coder/coder/v2/coderd/database/dbtestutil"
2726
"github.com/coder/coder/v2/coderd/database/dbtime"
2827
"github.com/coder/coder/v2/coderd/notifications"
2928
"github.com/coder/coder/v2/coderd/notifications/notificationstest"
@@ -55,10 +54,6 @@ func TestAITasksPrompts(t *testing.T) {
5554
t.Run("MultipleBuilds",func(t*testing.T) {
5655
t.Parallel()
5756

58-
if!dbtestutil.WillUsePostgres() {
59-
t.Skip("This test checks RBAC, which is not supported in the in-memory database")
60-
}
61-
6257
adminClient:=coderdtest.New(t,&coderdtest.Options{IncludeProvisionerDaemon:true})
6358
first:=coderdtest.CreateFirstUser(t,adminClient)
6459
memberClient,_:=coderdtest.CreateAnotherUser(t,adminClient,first.OrganizationID)

‎coderd/autobuild/lifecycle_executor_test.go‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -776,10 +776,6 @@ func TestExecutorWorkspaceAutostopNoWaitChangedMyMind(t *testing.T) {
776776
}
777777

778778
funcTestExecutorAutostartMultipleOK(t*testing.T) {
779-
if!dbtestutil.WillUsePostgres() {
780-
t.Skip(`This test only really works when using a "real" database, similar to a HA setup`)
781-
}
782-
783779
t.Parallel()
784780

785781
var (
@@ -1259,10 +1255,6 @@ func TestNotifications(t *testing.T) {
12591255
funcTestExecutorPrebuilds(t*testing.T) {
12601256
t.Parallel()
12611257

1262-
if!dbtestutil.WillUsePostgres() {
1263-
t.Skip("this test requires postgres")
1264-
}
1265-
12661258
// Prebuild workspaces should not be autostopped when the deadline is reached.
12671259
// After being claimed, the workspace should stop at the deadline.
12681260
t.Run("OnlyStopsAfterClaimed",func(t*testing.T) {

‎coderd/database/db_test.go‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ func TestNestedInTx(t *testing.T) {
8585
functestSQLDB(t testing.TB)*sql.DB {
8686
t.Helper()
8787

88-
if!dbtestutil.WillUsePostgres() {
89-
t.Skip("this test requires postgres")
90-
}
91-
9288
connection,err:=dbtestutil.Open(t)
9389
require.NoError(t,err)
9490

‎coderd/database/dbauthz/dbauthz_test.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,7 +2970,6 @@ func (s *MethodTestSuite) TestSystemFunctions() {
29702970
dbm.EXPECT().GetParameterSchemasByJobID(gomock.Any(),jobID).Return([]database.ParameterSchema{},nil).AnyTimes()
29712971
check.Args(jobID).
29722972
Asserts(tpl,policy.ActionRead).
2973-
ErrorsWithInMemDB(sql.ErrNoRows).
29742973
Returns([]database.ParameterSchema{})
29752974
}))
29762975
s.Run("GetWorkspaceAppsByAgentIDs",s.Mocked(func(dbm*dbmock.MockStore,faker*gofakeit.Faker,check*expects) {
@@ -3213,7 +3212,7 @@ func (s *MethodTestSuite) TestSystemFunctions() {
32133212
}))
32143213
s.Run("GetAppSecurityKey",s.Mocked(func(dbm*dbmock.MockStore,_*gofakeit.Faker,check*expects) {
32153214
dbm.EXPECT().GetAppSecurityKey(gomock.Any()).Return("",sql.ErrNoRows).AnyTimes()
3216-
check.Args().Asserts(rbac.ResourceSystem,policy.ActionRead).ErrorsWithPG(sql.ErrNoRows)
3215+
check.Args().Asserts(rbac.ResourceSystem,policy.ActionRead).Errors(sql.ErrNoRows)
32173216
}))
32183217
s.Run("UpsertAppSecurityKey",s.Mocked(func(dbm*dbmock.MockStore,_*gofakeit.Faker,check*expects) {
32193218
dbm.EXPECT().UpsertAppSecurityKey(gomock.Any(),"foo").Return(nil).AnyTimes()

‎coderd/database/dbauthz/setup_test.go‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -430,24 +430,6 @@ func (m *expects) Errors(err error) *expects {
430430
returnm
431431
}
432432

433-
// ErrorsWithPG is optional. If it is never called, it will not be asserted.
434-
// It will only be asserted if the test is running with a Postgres database.
435-
func (m*expects)ErrorsWithPG(errerror)*expects {
436-
ifdbtestutil.WillUsePostgres() {
437-
returnm.Errors(err)
438-
}
439-
returnm
440-
}
441-
442-
// ErrorsWithInMemDB is optional. If it is never called, it will not be asserted.
443-
// It will only be asserted if the test is running with an in-memory database.
444-
func (m*expects)ErrorsWithInMemDB(errerror)*expects {
445-
if!dbtestutil.WillUsePostgres() {
446-
returnm.Errors(err)
447-
}
448-
returnm
449-
}
450-
451433
func (m*expects)FailSystemObjectChecks()*expects {
452434
returnm.WithSuccessAuthorizer(func(ctx context.Context,subject rbac.Subject,action policy.Action,obj rbac.Object)error {
453435
ifobj.Type==rbac.ResourceSystem.Type {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp