Skip to content

[TF-27883] Add agent execution mode and pool to test config#1832

Merged
ctrombley merged 1 commit intomainfrom
hashiomoon/TF-27883-agent-pool
Oct 8, 2025
Merged

[TF-27883] Add agent execution mode and pool to test config#1832
ctrombley merged 1 commit intomainfrom
hashiomoon/TF-27883-agent-pool

Conversation

@hashimoon
Copy link
Copy Markdown
Contributor

@hashimoon hashimoon commented Sep 6, 2025

Description

Introduces 'agent_execution_mode' and 'agent_pool_id' fields to the registry module test_config schema, supporting both agent and remote execution modes. Adds validation to prevent agent_pool_id from being set when execution mode is 'remote', updates create, update, and read logic, and provides comprehensive acceptance tests for new behaviors. Also updates dependencies to latest versions.

Screenshot 2025-09-05 at 11 17 09 PM Screenshot 2025-09-05 at 11 17 28 PM Screenshot 2025-09-05 at 11 17 47 PM Screenshot 2025-09-05 at 11 18 03 PM

Remember to:

Testing plan

  1. Create a registry module with agent execution mode:
    - Apply the first Terraform config above
    - Verify in TFE/TFC UI that the module's test configuration shows agent execution mode
    - Verify the specified agent pool is being used
  2. Update from remote to agent execution mode:
    - Start with a module using remote execution
    - Update the configuration to use agent execution mode with an agent pool
    - Run terraform apply and verify the change is applied successfully
  3. Clear agent pool configuration:
    - Start with a module using agent execution mode
    - Change agent_execution_mode back to "remote" and remove agent_pool_id
    - Verify the module reverts to remote execution
  4. Validation testing:
    - Attempt to set agent_pool_id without setting agent_execution_mode = "agent"
    - Verify that Terraform returns the appropriate validation error

External links

Include any links here that might be helpful for people reviewing your PR. If there are none, feel free to delete this section.

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.

go test -v ./internal/provider -run "TestAccTFERegistryModule_agentExecutionModeWithAgentPool|TestAccTFERegistryModule_remoteExecutionModeWithoutAgentPool|TestAccTFERegistryModule_agentPoolFieldClearing|TestAccTFERegistryModule_remoteExecutionModeWithAgentPoolError"
=== RUN   TestAccTFERegistryModule_agentExecutionModeWithAgentPool
--- PASS: TestAccTFERegistryModule_agentExecutionModeWithAgentPool (6.03s)
=== RUN   TestAccTFERegistryModule_remoteExecutionModeWithoutAgentPool
--- PASS: TestAccTFERegistryModule_remoteExecutionModeWithoutAgentPool (5.48s)
=== RUN   TestAccTFERegistryModule_agentPoolFieldClearing
--- PASS: TestAccTFERegistryModule_agentPoolFieldClearing (5.41s)
=== RUN   TestAccTFERegistryModule_remoteExecutionModeWithAgentPoolError
--- PASS: TestAccTFERegistryModule_remoteExecutionModeWithAgentPoolError (0.22s)
PASS
ok  	github.com/hashicorp/terraform-provider-tfe/internal/provider	17.628s
...

Rollback Plan

Changes to Security Controls

@hashimoon hashimoon requested a review from a team as a code owner September 6, 2025 06:04
@hashimoon hashimoon force-pushed the hashiomoon/TF-27883-agent-pool branch 2 times, most recently from 01cc650 to 155e0ca Compare September 6, 2025 06:26
@hashimoon hashimoon force-pushed the hashiomoon/TF-27883-agent-pool branch from 155e0ca to 0cab058 Compare September 22, 2025 17:28
@hashimoon hashimoon force-pushed the hashiomoon/TF-27883-agent-pool branch 3 times, most recently from 4335987 to 8e312df Compare October 6, 2025 18:11
@hashimoon hashimoon mentioned this pull request Oct 6, 2025
2 tasks
@hashimoon hashimoon force-pushed the hashiomoon/TF-27883-agent-pool branch from 2d75ff9 to 4432e3e Compare October 7, 2025 01:28
Introduces 'agent_execution_mode' and 'agent_pool_id' fields to the registry module test_config schema, supporting both agent and remote execution modes. Adds validation to prevent agent_pool_id from being set when execution mode is 'remote', updates create, update, and read logic, and provides comprehensive acceptance tests for new behaviors. Also updates dependencies to latest versions.
@ctrombley ctrombley force-pushed the hashiomoon/TF-27883-agent-pool branch from 6a6f579 to 6dc67ae Compare October 8, 2025 21:21
Copy link
Copy Markdown
Collaborator

@ctrombley ctrombley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you @hashimoon!

@ctrombley ctrombley merged commit f90f580 into main Oct 8, 2025
29 checks passed
@ctrombley ctrombley deleted the hashiomoon/TF-27883-agent-pool branch October 8, 2025 22:12
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