Skip to content

Commit

Permalink
e2e: Update e2e tests to match new e2e infra Nomad region name.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasell committed Dec 19, 2024
1 parent 04e930b commit cf12df4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions e2e/cni/cni_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func testCNIArgs(t *testing.T) {
job, _ := jobs3.Submit(t, "./input/cni_args.nomad.hcl")
logs := job.Exec("group", "task", []string{"cat", "local/victory"})
t.Logf("FancyMessage: %s", logs.Stdout)
// "global" is the Nomad node's region, interpolated in the jobspec,
// "e2e" is the Nomad node's region, interpolated in the jobspec,
// passed through the CNI plugin, and cat-ed by the task.
must.Eq(t, "global\n", logs.Stdout)
must.Eq(t, "e2e\n", logs.Stdout)
}
26 changes: 13 additions & 13 deletions e2e/jobsubmissions/jobsubapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func testRunCLIVarFlags(t *testing.T) {

// check the submission api
sub, _, err := nomad.Jobs().Submission(jobID, 0, &api.QueryOptions{
Region: "global",
Region: "e2e",
Namespace: "default",
})
must.NoError(t, err)
Expand All @@ -101,7 +101,7 @@ func testRunCLIVarFlags(t *testing.T) {

// check the submission api for v1
sub, _, err = nomad.Jobs().Submission(jobID, 1, &api.QueryOptions{
Region: "global",
Region: "e2e",
Namespace: "default",
})
must.NoError(t, err)
Expand All @@ -112,7 +112,7 @@ func testRunCLIVarFlags(t *testing.T) {

// check the submission api for v0 (make sure we still have it)
sub, _, err = nomad.Jobs().Submission(jobID, 0, &api.QueryOptions{
Region: "global",
Region: "e2e",
Namespace: "default",
})
must.NoError(t, err)
Expand All @@ -130,7 +130,7 @@ func testRunCLIVarFlags(t *testing.T) {

// check the submission api for v0 after deregister (make sure its gone)
sub, _, err = nomad.Jobs().Submission(jobID, 0, &api.QueryOptions{
Region: "global",
Region: "e2e",
Namespace: "default",
})
must.ErrorContains(t, err, "job source not found")
Expand All @@ -150,7 +150,7 @@ func testSubmissionACL(t *testing.T) {
_, err := namespaceClient.Register(&api.Namespace{
Name: myNamespaceName,
}, &api.WriteOptions{
Region: "global",
Region: "e2e",
})
must.NoError(t, err)
aclCleanup.Add(myNamespaceName, acl.NamespaceTestResourceType)
Expand All @@ -160,7 +160,7 @@ func testSubmissionACL(t *testing.T) {
_, err = namespaceClient.Register(&api.Namespace{
Name: otherNamespaceName,
}, &api.WriteOptions{
Region: "global",
Region: "e2e",
})
must.NoError(t, err)
aclCleanup.Add(otherNamespaceName, acl.NamespaceTestResourceType)
Expand Down Expand Up @@ -192,7 +192,7 @@ func testSubmissionACL(t *testing.T) {
Type: "client",
Policies: []string{myNamespacePolicy.Name},
}, &api.WriteOptions{
Region: "global",
Region: "e2e",
Namespace: myNamespaceName,
})
must.NoError(t, err)
Expand All @@ -204,7 +204,7 @@ func testSubmissionACL(t *testing.T) {
Type: "client",
Policies: []string{otherNamespacePolicy.Name},
}, &api.WriteOptions{
Region: "global",
Region: "e2e",
Namespace: otherNamespaceName,
})
must.NoError(t, err)
Expand Down Expand Up @@ -232,7 +232,7 @@ func testSubmissionACL(t *testing.T) {

// get submission using my token
sub, _, err := nomad.Jobs().Submission(jobID, 0, &api.QueryOptions{
Region: "global",
Region: "e2e",
Namespace: myNamespaceName,
AuthToken: myToken.SecretID,
})
Expand All @@ -244,7 +244,7 @@ func testSubmissionACL(t *testing.T) {

// get submission using other token (fail)
sub, _, err = nomad.Jobs().Submission(jobID, 0, &api.QueryOptions{
Region: "global",
Region: "e2e",
Namespace: myNamespaceName,
AuthToken: otherToken.SecretID,
})
Expand Down Expand Up @@ -274,7 +274,7 @@ func testMaxSize(t *testing.T) {
// check the submission api making sure it is not there
nomad := e2eutil.NomadClient(t)
sub, _, err := nomad.Jobs().Submission(jobID, 0, &api.QueryOptions{
Region: "global",
Region: "e2e",
Namespace: "default",
})
must.ErrorContains(t, err, "job source not found")
Expand Down Expand Up @@ -313,7 +313,7 @@ func testReversion(t *testing.T) {
expectY := []string{"0", "1", "2", "1"}
for version := 0; version < 4; version++ {
sub, _, err := nomad.Jobs().Submission(jobID, version, &api.QueryOptions{
Region: "global",
Region: "e2e",
Namespace: "default",
})
must.NoError(t, err)
Expand Down Expand Up @@ -348,7 +348,7 @@ func testVarFiles(t *testing.T) {

// get submission
sub, _, err := nomad.Jobs().Submission(jobID, version, &api.QueryOptions{
Region: "global",
Region: "e2e",
Namespace: "default",
})
must.NoError(t, err)
Expand Down

0 comments on commit cf12df4

Please sign in to comment.