@@ -57,15 +57,19 @@ func TestIntegration(t *testing.T) {
57
57
require .NoError (t , err , "invalid value specified for timeout" )
58
58
ctx , cancel := context .WithTimeout (context .Background (), time .Duration (timeoutMins )* time .Minute )
59
59
t .Cleanup (cancel )
60
+ ctrID := setup (ctx , t , t .Name (), coderImg , coderVersion )
60
61
61
62
for _ , tt := range []struct {
62
63
// Name of the folder under `integration/` containing a test template
63
64
name string
65
+ // Minimum coder version for which to run this test
66
+ minVersion string
64
67
// map of string to regex to be passed to assertOutput()
65
68
expectedOutput map [string ]string
66
69
}{
67
70
{
68
- name : "test-data-source" ,
71
+ name : "test-data-source" ,
72
+ minVersion : "v0.0.0" ,
69
73
expectedOutput : map [string ]string {
70
74
"provisioner.arch" : runtime .GOARCH ,
71
75
"provisioner.id" : `[a-zA-Z0-9-]+` ,
@@ -86,6 +90,31 @@ func TestIntegration(t *testing.T) {
86
90
"workspace.template_name" : `test-data-source` ,
87
91
"workspace.template_version" : `.+` ,
88
92
"workspace.transition" : `start` ,
93
+ },
94
+ },
95
+ {
96
+ name : "workspace-owner" ,
97
+ minVersion : "v2.12.0" ,
98
+ expectedOutput : map [string ]string {
99
+ "provisioner.arch" : runtime .GOARCH ,
100
+ "provisioner.id" : `[a-zA-Z0-9-]+` ,
101
+ "provisioner.os" : runtime .GOOS ,
102
+ "workspace.access_port" : `\d+` ,
103
+ "workspace.access_url" : `https?://\D+:\d+` ,
104
+ "workspace.id" : `[a-zA-z0-9-]+` ,
105
+ "workspace.name" : `` ,
106
+ "workspace.owner" : `testing` ,
107
+ "workspace.owner_email" : `testing@coder\.com` ,
108
+ "workspace.owner_groups" : `\[\]` ,
109
+ "workspace.owner_id" : `[a-zA-Z0-9]+` ,
110
+ "workspace.owner_name" : `default` ,
111
+ "workspace.owner_oidc_access_token" : `^$` , // TODO: need a test OIDC integration
112
+ "workspace.owner_session_token" : `[a-zA-Z0-9-]+` ,
113
+ "workspace.start_count" : `1` ,
114
+ "workspace.template_id" : `[a-zA-Z0-9-]+` ,
115
+ "workspace.template_name" : `workspace-owner` ,
116
+ "workspace.template_version" : `.+` ,
117
+ "workspace.transition" : `start` ,
89
118
"workspace_owner.email" : `testing@coder\.com` ,
90
119
"workspace_owner.full_name" : `default` ,
91
120
"workspace_owner.groups" : `\[\]` ,
@@ -98,9 +127,13 @@ func TestIntegration(t *testing.T) {
98
127
},
99
128
},
100
129
} {
130
+ tt := tt
101
131
t .Run (tt .name , func (t * testing.T ) {
132
+ t .Parallel ()
133
+ if coderVersion != "latest" && semver .Compare (coderVersion , tt .minVersion ) < 0 {
134
+ t .Skipf ("skipping due to CODER_VERSION %q < minVersion %q" , coderVersion , tt .minVersion )
135
+ }
102
136
// Given: we have an existing Coder deployment running locally
103
- ctrID := setup (ctx , t , tt .name , coderImg , coderVersion )
104
137
// Import named template
105
138
106
139
// NOTE: Template create command was deprecated after this version
0 commit comments