Skip to main content

run-acctests

Executes acceptance tests (testacc) for a specific resource or suite in the GA or beta provider and outputs verbose debug logs.

来源信息

仓库
GoogleCloudPlatform/magic-modules
最近来源活动
2026年10月22日 23:10
检测到的 SKILL.md 语言
英语
星标
975
Forks
2,589

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
run-acctests
description
Executes acceptance tests (testacc) for a specific resource or suite in the GA or beta provider and outputs verbose debug logs.
# `run-acctests` > **Note to AI Agents:** You MUST read the YAML frontmatter above first. Only read the rest of this file if the `description` matches your current roadblock or required task. ## Prerequisites * Know the provider (`beta` or `ga`), service (e.g. `compute`), and test name (e.g. `TestAccComputeInstance_basic`). * The provider must be generated from your current changes (`generate-provider` with the same `VERSION`). * PR CI only runs beta acceptance tests, so run GA locally whenever GA behavior matters. ## Execution Steps ### 1. Select the provider ```bash VERSION="beta" # or "ga" if [ "$VERSION" = "ga" ]; then REPO=terraform-provider-google; PKG_DIR=google else REPO=terraform-provider-google-beta; PKG_DIR=google-beta fi cd "${GOPATH:-$HOME/go}/src/github.com/hashicorp/$REPO" && pwd ``` ### 2. Run the test List all `func TestAcc` functions in the target test file (`grep '^func TestAcc' <test_file>`) and explicitly run each relevant test. Stream `TF_LOG=DEBUG` output to a log file so failures can be parsed. ```bash TF_LOG=DEBUG make testacc TEST=./$PKG_DIR/services/<SERVICE_NAME> TESTARGS='-run=<TEST_NAME>$$' > test_output_$VERSION.log 2>&1 ``` `no tests to run` on GA usually means the test isn't generated for GA (still guarded or `min_version: beta`). That is a finding, not a pass. ### 3. Verification & Handoff * If the test succeeds, return to your primary workflow. * If the test fails, do **NOT** attempt a blind fix immediately. You MUST invoke the `parse-debug-logs` skill on the log file to understand the API failure before proposing a fix.
在 GitHub 查看