run-acceptance-tests

We need to translate the given English text into Russian. The text describes a skill for running acceptance tests for Terraform providers. The name "run-acceptance-tests" is not in the text, so we don't include it. We must preserve technical terms like "go test", "TF_ACC", "TestAccFeatureHappyPath", "TestCheckFunc", etc. Also preserve numbers, URLs (none here), and protocol names. No extra commentary. The text: "Execute and diagnose Go acceptance tests for Terraform providers with structured troubleshooting. Run focused acceptance tests using go test -run=TestAccFeatureHappyPath with TF_ACC=1 environment variable Diagnose failures progressively: retry with -count=1 , enable verbose output with -v , activate debug logging via TF_LOG=debug , and persist Terraform workspace with TF_ACC_WORKING_DIR_PERSIST=1 Validate test reliability by intentionally breaking a TestCheckFunc, re-running the test to..." We need to translate into Russian. Keep technical terms in English. Ensure proper punctuation and spacing. Let's

npx skills add https://github.com/hashicorp/agent-skills --skill run-acceptance-tests

An acceptance test is a Go test function with the prefix TestAcc.

Before running: acceptance tests create real infrastructure against the provider's live API, which may incur cost. Confirm the configured credentials point at a test account before proceeding.

To run a focused acceptance test named TestAccFeatureHappyPath:

  1. Run go test -run=TestAccFeatureHappyPath -timeout 60m with the following environment variables:

    • TF_ACC=1

    Default to non-verbose test output. Always pass an explicit -timeout: go test kills any test run after 10 minutes by default, and acceptance tests routinely exceed that.

  2. The acceptance tests may require additional environment variables for specific providers. To discover which ones:

    • Read the test's PreCheck / testAccPreCheck function and search the test files: grep -rn "os.Getenv" --include="*_test.go".
    • Check the repository's README, CONTRIBUTING, or .env.example for documented test setup.
    • The provider's Configure method shows how credentials are resolved; use the provider-configuration skill (if available) to understand a credential provider chain.

    Set the variables for the single test invocation (EXAMPLE_API_KEY=... TF_ACC=1 go test ...) rather than exporting them into the shell profile, and never write secret values into files inside the repository.

To diagnose a failing acceptance test, use these options, in order. These options are cumulative: each option includes all the options above it.

  1. Run the test again. Use the -count=1 option to ensure that go test does not use a cached result.
  2. Offer verbose go test output. Use the -v option.
  3. Offer debug-level logging. Enable debug-level logging with the environment variable TF_LOG=debug.
  4. Offer to persist the acceptance test's Terraform workspace. Enable persistence with the environment variable TF_ACC_WORKING_DIR_PERSIST=1.

A passing acceptance test may be a false negative. To "flip" a passing acceptance test named TestAccFeatureHappyPath:

  1. Edit the value of one of the TestCheckFuncs in one of the TestSteps in the TestCase.
  2. Run the acceptance test. Expect the test to fail.
  3. If the test fails, then undo the edit and report a successful flip. Else, keep the edit and report an unsuccessful flip.

If a test run is interrupted, real resources may be left behind; run the provider's sweepers if it registers them (see the provider-test-patterns skill's sweeper reference, if available). For writing or restructuring tests, use the provider-test-patterns skill.

Больше skills от hashicorp

provider-actions
hashicorp
Реализуйте действия провайдера Terraform с помощью Plugin Framework. Используйте при разработке императивных операций, которые выполняются на этапах жизненного цикла (до/после…
official
new-terraform-provider
hashicorp
Use this when scaffolding a new Terraform provider with the Plugin Framework: workspace layout, go module setup, provider server main.go, and a provider.go…
official
terraform-test
hashicorp
Comprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating…
official
terraform-test
hashicorp
Полное руководство по написанию и запуску тестов Terraform с утверждениями, мокированием и валидацией модулей. Создавайте тестовые файлы с использованием синтаксиса .tftest.hcl и блоков run, которые выполняются в режиме plan или apply, поддерживая последовательное и параллельное выполнение с опциональной изоляцией состояния. Утверждайте условия для атрибутов ресурсов, выходных данных и источников данных; используйте expect_failures для проверки корректного отклонения недопустимых входных данных. Мокируйте провайдеры (Terraform 1.7.0+) для симуляции поведения инфраструктуры без...
official
provider-actions
hashicorp
Реализация императивных действий провайдера Terraform в событиях жизненного цикла ресурсов с использованием Plugin Framework. Поддерживает триггеры жизненного цикла до/после создания и до/после обновления (события уничтожения недоступны в Terraform 1.14.0). Требует правильного определения схемы с корректными типами фреймворка, ElementType для коллекций и валидаторами для проверки входных данных. Включает отчетность о прогрессе, управление таймаутами и всестороннюю обработку ошибок для длительных операций. Реализует опрос и...
official
aws-ami-builder
hashicorp
Создаёт пользовательские образы Amazon Machine Images с помощью сборщика amazon-ebs из Packer. Автоматизирует создание AMI из исходных AMI с использованием HCL-шаблонов и провизионеров для настройки (скрипты оболочки, загрузка файлов, управление конфигурацией). Поддерживает многрегиональное распространение AMI через ami_regions и гибкую фильтрацию исходных AMI по имени, владельцу и типу виртуализации. Аутентифицируется через переменные окружения, файл учётных данных AWS или профили экземпляров IAM; включает команды проверки и сборки для шаблона...
official
new-terraform-provider
hashicorp
Создание каркаса нового провайдера Terraform с использованием Plugin Framework. Генерирует новую рабочую область модуля Go с стандартным соглашением об именовании "terraform-provider-" и инициализирует необходимые зависимости. Предоставляет шаблонный файл main.go, следующий шаблонам Plugin Framework от HashiCorp, с маркерами TODO для настройки. Проверяет настройку, выполняя команды сборки и тестирования, чтобы убедиться, что провайдер компилируется и проходит начальные проверки. Управляет рабочей областью, запрашивая подтверждение намерения перед созданием новой...
official
azure-verified-modules
hashicorp
Требования к сертификации и лучшие практики для модулей Azure Terraform, стремящихся к соответствию AVM. Обеспечивает соблюдение ограничений версий провайдера (azurerm >= 4.0, < 5.0; azapi >= 2.0, < 3.0) и запрещает ссылки на модули на основе git в пользу закрепленных источников реестра Terraform. Требует использования нижнего регистра с подчеркиваниями для всех идентификаторов, точных типов переменных, отдельных атрибутов вывода через шаблон антикоррупционного слоя и упорядоченных по алфавиту локальных переменных. Требует переменных переключателей функций для добавляемых новых ресурсов...
official