@@ -1692,7 +1692,7 @@ func (s *MethodTestSuite) TestUser() {
1692
1692
check .Args (database.DeleteCustomRoleParams {
1693
1693
Name : customRole .Name ,
1694
1694
}).Asserts (
1695
- // fails immediately, missing organization id
1695
+ // fails immediately, missing organization id
1696
1696
).Errors (dbauthz.NotAuthorizedError {Err : xerrors .New ("custom roles must belong to an organization" )})
1697
1697
}))
1698
1698
s .Run ("Blank/UpdateCustomRole" , s .Subtest (func (db database.Store , check * expects ) {
@@ -1723,7 +1723,7 @@ func (s *MethodTestSuite) TestUser() {
1723
1723
codersdk .ResourceWorkspace : {codersdk .ActionRead },
1724
1724
}), convertSDKPerm ),
1725
1725
}).Asserts (
1726
- // fails immediately, missing organization id
1726
+ // fails immediately, missing organization id
1727
1727
).Errors (dbauthz.NotAuthorizedError {Err : xerrors .New ("custom roles must belong to an organization" )})
1728
1728
}))
1729
1729
s .Run ("OrgPermissions/UpdateCustomRole" , s .Subtest (func (db database.Store , check * expects ) {
@@ -1776,7 +1776,7 @@ func (s *MethodTestSuite) TestUser() {
1776
1776
codersdk .ResourceWorkspace : {codersdk .ActionRead },
1777
1777
}), convertSDKPerm ),
1778
1778
}).Asserts (
1779
- // fails immediately, missing organization id
1779
+ // fails immediately, missing organization id
1780
1780
).Errors (dbauthz.NotAuthorizedError {Err : xerrors .New ("custom roles must belong to an organization" )})
1781
1781
}))
1782
1782
s .Run ("OrgPermissions/InsertCustomRole" , s .Subtest (func (db database.Store , check * expects ) {
@@ -3757,7 +3757,7 @@ func (s *MethodTestSuite) TestSystemFunctions() {
3757
3757
s .Run ("GetProvisionerJobsCreatedAfter" , s .Subtest (func (db database.Store , check * expects ) {
3758
3758
// TODO: add provisioner job resource type
3759
3759
_ = dbgen .ProvisionerJob (s .T (), db , nil , database.ProvisionerJob {CreatedAt : time .Now ().Add (- time .Hour )})
3760
- check .Args (time .Now ()).Asserts ( /*rbac.ResourceSystem, policy.ActionRead*/ )
3760
+ check .Args (time .Now ()).Asserts ( /*rbac.ResourceSystem, policy.ActionRead*/ )
3761
3761
}))
3762
3762
s .Run ("GetTemplateVersionsByIDs" , s .Subtest (func (db database.Store , check * expects ) {
3763
3763
dbtestutil .DisableForeignKeysAndTriggers (s .T (), db )
@@ -3934,7 +3934,7 @@ func (s *MethodTestSuite) TestSystemFunctions() {
3934
3934
a := dbgen .ProvisionerJob (s .T (), db , nil , database.ProvisionerJob {})
3935
3935
b := dbgen .ProvisionerJob (s .T (), db , nil , database.ProvisionerJob {})
3936
3936
check .Args ([]uuid.UUID {a .ID , b .ID }).
3937
- Asserts ( /*rbac.ResourceSystem, policy.ActionRead*/ ).
3937
+ Asserts ( /*rbac.ResourceSystem, policy.ActionRead*/ ).
3938
3938
Returns (slice .New (a , b ))
3939
3939
}))
3940
3940
s .Run ("InsertWorkspaceAgent" , s .Subtest (func (db database.Store , check * expects ) {
@@ -3979,22 +3979,22 @@ func (s *MethodTestSuite) TestSystemFunctions() {
3979
3979
OrganizationID : j .OrganizationID ,
3980
3980
Types : []database.ProvisionerType {j .Provisioner },
3981
3981
ProvisionerTags : must (json .Marshal (j .Tags )),
3982
- }).Asserts ( /*rbac.ResourceSystem, policy.ActionUpdate*/ )
3982
+ }).Asserts ( /*rbac.ResourceSystem, policy.ActionUpdate*/ )
3983
3983
}))
3984
3984
s .Run ("UpdateProvisionerJobWithCompleteByID" , s .Subtest (func (db database.Store , check * expects ) {
3985
3985
// TODO: we need to create a ProvisionerJob resource
3986
3986
j := dbgen .ProvisionerJob (s .T (), db , nil , database.ProvisionerJob {})
3987
3987
check .Args (database.UpdateProvisionerJobWithCompleteByIDParams {
3988
3988
ID : j .ID ,
3989
- }).Asserts ( /*rbac.ResourceSystem, policy.ActionUpdate*/ )
3989
+ }).Asserts ( /*rbac.ResourceSystem, policy.ActionUpdate*/ )
3990
3990
}))
3991
3991
s .Run ("UpdateProvisionerJobByID" , s .Subtest (func (db database.Store , check * expects ) {
3992
3992
// TODO: we need to create a ProvisionerJob resource
3993
3993
j := dbgen .ProvisionerJob (s .T (), db , nil , database.ProvisionerJob {})
3994
3994
check .Args (database.UpdateProvisionerJobByIDParams {
3995
3995
ID : j .ID ,
3996
3996
UpdatedAt : time .Now (),
3997
- }).Asserts ( /*rbac.ResourceSystem, policy.ActionUpdate*/ )
3997
+ }).Asserts ( /*rbac.ResourceSystem, policy.ActionUpdate*/ )
3998
3998
}))
3999
3999
s .Run ("InsertProvisionerJob" , s .Subtest (func (db database.Store , check * expects ) {
4000
4000
dbtestutil .DisableForeignKeysAndTriggers (s .T (), db )
@@ -4005,21 +4005,21 @@ func (s *MethodTestSuite) TestSystemFunctions() {
4005
4005
StorageMethod : database .ProvisionerStorageMethodFile ,
4006
4006
Type : database .ProvisionerJobTypeWorkspaceBuild ,
4007
4007
Input : json .RawMessage ("{}" ),
4008
- }).Asserts ( /*rbac.ResourceSystem, policy.ActionCreate*/ )
4008
+ }).Asserts ( /*rbac.ResourceSystem, policy.ActionCreate*/ )
4009
4009
}))
4010
4010
s .Run ("InsertProvisionerJobLogs" , s .Subtest (func (db database.Store , check * expects ) {
4011
4011
// TODO: we need to create a ProvisionerJob resource
4012
4012
j := dbgen .ProvisionerJob (s .T (), db , nil , database.ProvisionerJob {})
4013
4013
check .Args (database.InsertProvisionerJobLogsParams {
4014
4014
JobID : j .ID ,
4015
- }).Asserts ( /*rbac.ResourceSystem, policy.ActionCreate*/ )
4015
+ }).Asserts ( /*rbac.ResourceSystem, policy.ActionCreate*/ )
4016
4016
}))
4017
4017
s .Run ("InsertProvisionerJobTimings" , s .Subtest (func (db database.Store , check * expects ) {
4018
4018
// TODO: we need to create a ProvisionerJob resource
4019
4019
j := dbgen .ProvisionerJob (s .T (), db , nil , database.ProvisionerJob {})
4020
4020
check .Args (database.InsertProvisionerJobTimingsParams {
4021
4021
JobID : j .ID ,
4022
- }).Asserts ( /*rbac.ResourceSystem, policy.ActionCreate*/ )
4022
+ }).Asserts ( /*rbac.ResourceSystem, policy.ActionCreate*/ )
4023
4023
}))
4024
4024
s .Run ("UpsertProvisionerDaemon" , s .Subtest (func (db database.Store , check * expects ) {
4025
4025
dbtestutil .DisableForeignKeysAndTriggers (s .T (), db )
@@ -4675,30 +4675,31 @@ func (s *MethodTestSuite) TestPrebuilds() {
4675
4675
Asserts (rbac .ResourceTemplate , policy .ActionRead ).
4676
4676
ErrorsWithInMemDB (dbmem .ErrUnimplemented )
4677
4677
}))
4678
- s .Run ("InsertPresetPrebuild" , s .Subtest (func (db database.Store , check * expects ) {
4679
- org := dbgen .Organization (s .T (), db , database.Organization {})
4680
- user := dbgen .User (s .T (), db , database.User {})
4681
- template := dbgen .Template (s .T (), db , database.Template {
4682
- CreatedBy : user .ID ,
4683
- OrganizationID : org .ID ,
4684
- })
4685
- templateVersion := dbgen .TemplateVersion (s .T (), db , database.TemplateVersion {
4686
- TemplateID : uuid.NullUUID {UUID : template .ID , Valid : true },
4687
- OrganizationID : org .ID ,
4688
- CreatedBy : user .ID ,
4689
- })
4690
- preset := dbgen .Preset (s .T (), db , database.InsertPresetParams {
4691
- Name : coderdtest .RandomName (s .T ()),
4692
- TemplateVersionID : templateVersion .ID ,
4693
- })
4694
- check .Args (database.InsertPresetPrebuildParams {
4695
- ID : uuid .New (),
4696
- PresetID : preset .ID ,
4697
- DesiredInstances : 1 ,
4698
- }).
4699
- Asserts (rbac .ResourceSystem , policy .ActionCreate ).
4700
- ErrorsWithInMemDB (dbmem .ErrUnimplemented )
4701
- }))
4678
+ // TODO: remove?
4679
+ //s.Run("InsertPresetPrebuild", s.Subtest(func(db database.Store, check *expects) {
4680
+ // org := dbgen.Organization(s.T(), db, database.Organization{})
4681
+ // user := dbgen.User(s.T(), db, database.User{})
4682
+ // template := dbgen.Template(s.T(), db, database.Template{
4683
+ // CreatedBy: user.ID,
4684
+ // OrganizationID: org.ID,
4685
+ // })
4686
+ // templateVersion := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{
4687
+ // TemplateID: uuid.NullUUID{UUID: template.ID, Valid: true},
4688
+ // OrganizationID: org.ID,
4689
+ // CreatedBy: user.ID,
4690
+ // })
4691
+ // preset := dbgen.Preset(s.T(), db, database.InsertPresetParams{
4692
+ // Name: coderdtest.RandomName(s.T()),
4693
+ // TemplateVersionID: templateVersion.ID,
4694
+ // })
4695
+ // check.Args(database.InsertPresetPrebuildParams{
4696
+ // ID: uuid.New(),
4697
+ // PresetID: preset.ID,
4698
+ // DesiredInstances: 1,
4699
+ // }).
4700
+ // Asserts(rbac.ResourceSystem, policy.ActionCreate).
4701
+ // ErrorsWithInMemDB(dbmem.ErrUnimplemented)
4702
+ //}))
4702
4703
}
4703
4704
4704
4705
func (s * MethodTestSuite ) TestOAuth2ProviderApps () {
0 commit comments