writing-integration-tests

Guide integration test development for the SCT framework with external services.

73|112|Updated Dec 29, 2015
One-click install
npx skills add https://github.com/scylladb/scylla-cluster-tests --skill writing-integration-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-integration-tests
Source: https://github.com/scylladb/scylla-cluster-tests/tree/main/skills/writing-integration-tests
Command: npx skills add https://github.com/scylladb/scylla-cluster-tests --skill writing-integration-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance on writing, debugging, and maintaining integration tests within the SCT framework, ensuring reliable testing against external services.

Core Features & Use Cases

  • Test Marking: Enforces the use of @pytest.mark.integration for proper test execution.
  • Service Dependency Declaration: Guides on how to clearly label external service requirements (Docker, AWS, GCE, Azure, OCI, Kubernetes).
  • Resource Cleanup: Emphasizes the critical need for cleaning up all created resources to prevent leaks and cost overruns.
  • Use Case: You need to write a new test that provisions an EC2 instance on AWS and verifies its configuration. This Skill will guide you through marking the test correctly, handling AWS credentials, and ensuring the instance is terminated after the test.

Quick Start

Ensure all integration tests have the @pytest.mark.integration marker and clearly document their external service dependencies.

Frequently Asked Questions about writing-integration-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write integration tests that interact with real cloud services like AWS and Azure?

To write integration tests for cloud services, you must declare external service dependencies clearly and enforce the `@pytest.mark.integration` marker for proper test execution and isolation within the SCT framework.

What is the best way to manage resource cleanup in pytest integration tests?

The best way to manage resource cleanup in integration tests is to explicitly terminate all provisioned resources, such as EC2 instances, after execution to prevent cloud resource leaks and avoid unexpected cost overruns.

How do I mark a pytest test to run only when Docker or Kubernetes is available?

You mark a pytest test for conditional execution by using the `@pytest.mark.integration` marker and explicitly declaring Docker or Kubernetes as external service dependencies in the test documentation.

Why does my SCT integration test fail to execute properly during the pytest run?

Your SCT integration test fails to execute properly if it lacks the required `@pytest.mark.integration` marker or has undeclared external service dependencies, causing the framework to skip or misconfigure the test environment.

Do I need to manually handle cloud credentials when provisioning AWS resources in integration tests?

Yes, when provisioning AWS resources in integration tests, you need to handle AWS credentials explicitly within the test logic to ensure secure provisioning and successful verification of the cloud instances.

Can I use this guidance to test interactions across multiple cloud platforms like GCE and OCI?

Yes, you can use this guidance to test interactions across GCE and OCI, because it supports declaring dependencies for multiple external services including AWS, Azure, Docker, and Kubernetes environments.