Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/tfe_workspace_run: Ensure wait_for_run=false results in a fire-and-forget Run #910

Closed
wants to merge 2 commits into from

Conversation

lucymhdavies
Copy link
Contributor

@lucymhdavies lucymhdavies commented May 30, 2023

Description

Fix for #908

Remember to:

Output from acceptance tests

Please run applicable acceptance tests locally and include the output here. See testing.md to learn how to run acceptance tests.

If you are an external contributor, your contribution(s) will first be reviewed before running them against the project's CI pipeline.

$ TESTARGS="-run TestAccTFEWorkspaceRun" make testacc
TF_ACC=1 TF_LOG_SDK_PROTO=OFF go test $(go list ./... |grep -v 'vendor') -v -run TestAccTFEWorkspaceRun -timeout 15m
?   	github.com/hashicorp/terraform-provider-tfe	[no test files]
?   	github.com/hashicorp/terraform-provider-tfe/version	[no test files]
=== RUN   TestAccTFEWorkspaceRunTaskDataSource_basic
    testing.go:232: Skipping tests for Run Tasks. Set 'RUN_TASKS_URL' to enabled this tests.
--- SKIP: TestAccTFEWorkspaceRunTaskDataSource_basic (0.00s)
=== RUN   TestAccTFEWorkspaceRunTask_create
    testing.go:232: Skipping tests for Run Tasks. Set 'RUN_TASKS_URL' to enabled this tests.
--- SKIP: TestAccTFEWorkspaceRunTask_create (0.00s)
=== RUN   TestAccTFEWorkspaceRunTask_beta_create
    testing.go:232: Skipping tests for Run Tasks. Set 'RUN_TASKS_URL' to enabled this tests.
--- SKIP: TestAccTFEWorkspaceRunTask_beta_create (0.00s)
=== RUN   TestAccTFEWorkspaceRunTask_import
    testing.go:232: Skipping tests for Run Tasks. Set 'RUN_TASKS_URL' to enabled this tests.
--- SKIP: TestAccTFEWorkspaceRunTask_import (0.00s)
=== RUN   TestAccTFEWorkspaceRun_withApplyOnlyBlock
2023/05/30 12:09:55 [DEBUG] Configuring client for host "app.terraform.io"
2023/05/30 12:09:55 [DEBUG] Service discovery for app.terraform.io at https://app.terraform.io/.well-known/terraform.json
2023/05/30 12:09:56 [DEBUG] Attempting to fetch token from Terraform CLI configuration for hostname app.terraform.io...
    testing.go:89: failed to enumerate feature sets: resource not found
--- FAIL: TestAccTFEWorkspaceRun_withApplyOnlyBlock (0.92s)
=== RUN   TestAccTFEWorkspaceRun_withBothApplyAndDestroyBlocks
2023/05/30 12:09:56 [DEBUG] Configuring client for host "app.terraform.io"
2023/05/30 12:09:56 [DEBUG] Service discovery for app.terraform.io at https://app.terraform.io/.well-known/terraform.json
2023/05/30 12:09:57 [DEBUG] Attempting to fetch token from Terraform CLI configuration for hostname app.terraform.io...
    testing.go:89: failed to enumerate feature sets: resource not found
--- FAIL: TestAccTFEWorkspaceRun_withBothApplyAndDestroyBlocks (0.84s)
=== RUN   TestAccTFEWorkspaceRun_invalidParams
2023/05/30 12:09:57 [DEBUG] Configuring client for host "app.terraform.io"
2023/05/30 12:09:57 [DEBUG] Service discovery for app.terraform.io at https://app.terraform.io/.well-known/terraform.json
2023/05/30 12:09:57 [DEBUG] Attempting to fetch token from Terraform CLI configuration for hostname app.terraform.io...
    testing.go:89: failed to enumerate feature sets: resource not found
--- FAIL: TestAccTFEWorkspaceRun_invalidParams (0.86s)
=== RUN   TestAccTFEWorkspaceRun_WhenRunErrors
2023/05/30 12:09:58 [DEBUG] Configuring client for host "app.terraform.io"
2023/05/30 12:09:58 [DEBUG] Service discovery for app.terraform.io at https://app.terraform.io/.well-known/terraform.json
2023/05/30 12:09:58 [DEBUG] Attempting to fetch token from Terraform CLI configuration for hostname app.terraform.io...
    testing.go:89: failed to enumerate feature sets: resource not found
--- FAIL: TestAccTFEWorkspaceRun_WhenRunErrors (0.87s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-tfe/tfe	3.908s
FAIL
make: *** [testacc] Error 1

Which... I'm not sure if that's a problem with me running the tests, or if this is the tests failing because the functionality has changed. It seems like the former (some issue running the tests)

Tests are failing in GitHub Actions because this PR comes from my fork of the provider, and I believe we need to do some special additional steps to get that working.
(I don't have permissions on the repo myself to do that, hence the fork)


This is entirely untested (I don't have time right now)
@lucymhdavies lucymhdavies marked this pull request as ready for review May 30, 2023 11:34
@lucymhdavies lucymhdavies requested a review from a team as a code owner May 30, 2023 11:34
@brandonc
Copy link
Collaborator

brandonc commented Jun 1, 2023

@lucymhdavies I added hashicorp/team-se to collaborate on this repo. Can you push this branch directly to the repo in order to get access to CI?

@lucymhdavies
Copy link
Contributor Author

Closing in favor of #917

lucymhdavies added a commit that referenced this pull request Jun 1, 2023
github-merge-queue bot pushed a commit to panda-den/colorful-pandas that referenced this pull request Jul 4, 2023
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [tfe](https://registry.terraform.io/providers/hashicorp/tfe)
([source](https://github.com/hashicorp/terraform-provider-tfe)) |
required_provider | minor | `0.45.0` -> `0.46.0` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>hashicorp/terraform-provider-tfe (tfe)</summary>

###
[`v0.46.0`](https://github.com/hashicorp/terraform-provider-tfe/blob/HEAD/CHANGELOG.md#v0460-July-3-2023)

[Compare
Source](https://github.com/hashicorp/terraform-provider-tfe/compare/v0.45.0...v0.46.0)

FEATURES:

- **New Resource**: `r/tfe_agent_pool_allowed_workspaces` restricts the
use of an agent pool to particular workspaces, by
[@&#8203;hs26gill](https://github.com/hs26gill)
[870](https://github.com/hashicorp/terraform-provider-tfe/pull/870)
- `r/tfe_organization_token`: Add optional `expired_at` field to
organization tokens, by
[@&#8203;juliannatetreault](https://github.com/juliannatetreault)
(#&#8203[hashicorp/terraform-provider-tfe#844))
- `r/tfe_team_token`: Add optional `expired_at` field to team tokens, by
[@&#8203;juliannatetreault](https://github.com/juliannatetreault)
(#&#8203[hashicorp/terraform-provider-tfe#844))
- `r/tfe_agent_pool`: Add attribute `organization_scoped` to set the
scope of an agent pool, by
[@&#8203;hs26gill](https://github.com/hs26gill)
[870](https://github.com/hashicorp/terraform-provider-tfe/pull/870)
- `d/tfe_agent_pool`: Add attribute `organization_scoped` and
`allowed_workspace_ids` to retrieve agent pool scope and associated
allowed workspace ids, by
[@&#8203;hs26gill](https://github.com/hs26gill)
[870](https://github.com/hashicorp/terraform-provider-tfe/pull/870)

BUG FIXES:

- `r/tfe_workspace_run`: Ensure `wait_for_run` correctly results in a
fire-and-forget run when set to `false`, by
[@&#8203;lucymhdavies](https://github.com/lucymhdavies)
(#&#8203[hashicorp/terraform-provider-tfe#910))
- `r/tfe_workspace_run`: Fix rare random run failures; adjust lists of
expected run statuses to ensure that a plan is completely processed
before attempting to apply it, by
[@&#8203;uk1288](https://github.com/uk1288)
(#&#8203[hashicorp/terraform-provider-tfe#921))
- `r/tfe_notification_configuration`: Add support for missing "Check
failed" Health Event notifications, by
[@&#8203;lucymhdavies](https://github.com/lucymhdavies)
(#&#8203[hashicorp/terraform-provider-tfe#927))
- `r/tfe_registry_module`: Fix a bug that prevented users from being
able to create a registry module using a github app, by
[@&#8203;dsa0x](https://github.com/dsa0x)
(#&#8203[hashicorp/terraform-provider-tfe#935))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNTkuNCIsInVwZGF0ZWRJblZlciI6IjM1LjE1OS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: astronaut-panda[bot] <137164246+astronaut-panda[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants