Skip to content

Commit

Permalink
Standardize use of http://testing-mocks.tfe:22180/runtasks/pass betwe…
Browse files Browse the repository at this point in the history
…en CI and Nightly tests. Fix failing tests using incorrect format for query params.
  • Loading branch information
Maed223 committed Sep 18, 2024
1 parent dfc8953 commit de567c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
matrix_index: ${{ matrix.index }}
matrix_total: ${{ matrix.total }}
hostname: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).ngrok_domain }}
run_tasks_url: 'https://httpstat.us/200'
token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_token }}
testing-github-token: ${{ secrets.TESTING_GITHUB_TOKEN }}
admin_configuration_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.configuration }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func TestAccTFENotificationConfiguration_update(t *testing.T) {
resource.TestCheckResourceAttr(
"tfe_notification_configuration.foobar", "triggers.#", "2"),
resource.TestCheckResourceAttr(
"tfe_notification_configuration.foobar", "url", fmt.Sprintf("%s/?update=true", runTasksURL())),
"tfe_notification_configuration.foobar", "url", fmt.Sprintf("%s?update=true", runTasksURL())),
),
},
},
Expand Down Expand Up @@ -484,6 +484,8 @@ func TestAccTFENotificationConfiguration_duplicateTriggers(t *testing.T) {
func TestAccTFENotificationConfigurationImport_basic(t *testing.T) {
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()

fmt.Printf("Config for testAccTFENotificationConfigurationImport_basic:\n %s\n", testAccTFENotificationConfiguration_basic(rInt))

resource.Test(t, resource.TestCase{
PreCheck: func() { preCheckTFENotificationConfiguration(t) },
Providers: testAccProviders,
Expand Down Expand Up @@ -619,7 +621,7 @@ func testAccCheckTFENotificationConfigurationAttributesUpdate(notificationConfig
return fmt.Errorf("Bad triggers: %v", notificationConfiguration.Triggers)
}

if notificationConfiguration.URL != fmt.Sprintf("%s/?update=true", runTasksURL()) {
if notificationConfiguration.URL != fmt.Sprintf("%s?update=true", runTasksURL()) {
return fmt.Errorf("Bad URL: %s", notificationConfiguration.URL)
}

Expand Down Expand Up @@ -884,7 +886,7 @@ resource "tfe_notification_configuration" "foobar" {
enabled = true
token = "1234567890_update"
triggers = ["run:created", "run:needs_attention"]
url = "%s/?update=true"
url = "%s?update=true"
workspace_id = tfe_workspace.foobar.id
}`, rInt, runTasksURL())
}
Expand Down

0 comments on commit de567c3

Please sign in to comment.