Integration Test

Getting Started

Getting Started

Advanced Generation

Integration Test Generation from Trace

Introduction

This guide will show you how to generate integration tests for complex scenarios with Skyramp using Skyramp-collected traces. We'll demonstrate using Skyramp’s Demo Shop API, a simple e-commerce API for product and order management. Learn more about the Demo Shop API.

Ensure you have Skyramp CLI and relevant Libraries installed. If not, refer to the Installation Guide.

Generate Integration Tests across Endpoints

To generate integration tests that span across multiple endpoints or services, Skyramp requires trace information to reliably generate the test case. Learn more about trace collection with Skyramp [LINK].

Following, we will generate a test for a simple scenario across endpoints. You can download the trace file here.

  1. POST of a new product

  2. POST of a new order containing the new product

  3. GET of the new order

  4. DELETE of the new order

Integration Test Generation from Trace

Introduction

This guide will show you how to generate integration tests for complex scenarios with Skyramp using Skyramp-collected traces. We'll demonstrate using Skyramp’s Demo Shop API, a simple e-commerce API for product and order management. Learn more about the Demo Shop API.

Ensure you have Skyramp CLI and relevant Libraries installed. If not, refer to the Installation Guide.

Generate Integration Tests across Endpoints

To generate integration tests that span across multiple endpoints or services, Skyramp requires trace information to reliably generate the test case. Learn more about trace collection with Skyramp [LINK].

Following, we will generate a test for a simple scenario across endpoints. You can download the trace file here.

  1. POST of a new product

  2. POST of a new order containing the new product

  3. GET of the new order

  4. DELETE of the new order

Integration Test Generation from Trace

Introduction

This guide will show you how to generate integration tests for complex scenarios with Skyramp using Skyramp-collected traces. We'll demonstrate using Skyramp’s Demo Shop API, a simple e-commerce API for product and order management. Learn more about the Demo Shop API.

Ensure you have Skyramp CLI and relevant Libraries installed. If not, refer to the Installation Guide.

Generate Integration Tests across Endpoints

To generate integration tests that span across multiple endpoints or services, Skyramp requires trace information to reliably generate the test case. Learn more about trace collection with Skyramp [LINK].

Following, we will generate a test for a simple scenario across endpoints. You can download the trace file here.

  1. POST of a new product

  2. POST of a new order containing the new product

  3. GET of the new order

  4. DELETE of the new order

Python

Run the following command in your terminal to generate the integration test:

skyramp generate integration rest \
--language python \
--framework pytest \
--trace trace.json

Upon completion, Skyramp creates a fully executable Python test file (integration_test.py) that can be run immediately.

Explanation of Command

  • Compared to other commands, test generation from trace does not require a specified URL - we extract the various endpoints directly from the trace.

  • --language: Specifies the test output language.

  • --framework: Specify the test execution framework of choice.

  • --trace: Points to the Skyramp-collected trace used to generate the test. We extract all relevant scenario and request information directly from this file.

Additional Flags

Below are a few flags to customize the test generation. Additional flags are explained here.

  • --include: Specify a comma-separated list of FQDNs for Skyram to generate requests.

  • --exclude: Specify a comma-separated list of FQDNs for which you do not want Skyram to generate requests. This flag takes precedence over --include if a FQDN is specified in both.

  • --runtime: Select the test runtime environment [Local, Docker, Kubernetes]

  • --output: Specify the name of the generated test file.

FQDNs need to be specified either as an exact path to the endpoint or in combination with a wildcard:

  • demoshop.skyramp.dev/products will only generate requests for POST and GET of the products endpoint

  • demoshop.skyramp.dev/products/* will also include all nested endpoints

For endpoints that require path parameters, please replace the path parameter with the wildcard:

  • Convert demoshop.skyramp.dev/products/{product_id}/reviews to demoshop.skyramp.dev/products/*/reviews

Execute your Test

You can execute the generated tests without any additional adjustments to the code.

Set env variable for authentication

Ensure proper authentication for test execution. By default, we expect a Bearer Token but support additional authentication methods. If your API does not require any authentication, you can skip this step and just run the test.

export SKYRAMP_TEST_TOKEN=$your_auth_token

Run the test

Since the Skyramp Demo Shop does not require authentication, you can immediately execute the generated test using Pytest:

python3 -m pytest integration_test.py

The test automatically identifies the relevant path parameters, intelligently chains the different requests together, and executes the test against the captured URLs

Reviewing Test Results

By default, Pytest provides clear and concise output indicating the success or failure of each step executed:

  • Each executed test will be displayed clearly in the terminal.

  • All encountered errors or issues will be neatly summarized for easy debugging at the end.

You can customize Pytest’s output to suit your team's preferences by following the Pytest documentation.

Next Steps

Congratulations on generating an integration test from traces! To learn more about the generated code, please visit the Integration Test Documentation describing the core concepts.

Let’s automate testing together!

Related topics

Installation

Skyramp Demo Shop

Integration Test

Python

Run the following command in your terminal to generate the integration test:

skyramp generate integration rest \
--language python \
--framework pytest \
--trace trace.json

Upon completion, Skyramp creates a fully executable Python test file (integration_test.py) that can be run immediately.

Explanation of Command

  • Compared to other commands, test generation from trace does not require a specified URL - we extract the various endpoints directly from the trace.

  • --language: Specifies the test output language.

  • --framework: Specify the test execution framework of choice.

  • --trace: Points to the Skyramp-collected trace used to generate the test. We extract all relevant scenario and request information directly from this file.

Additional Flags

Below are a few flags to customize the test generation. Additional flags are explained here.

  • --include: Specify a comma-separated list of FQDNs for Skyram to generate requests.

  • --exclude: Specify a comma-separated list of FQDNs for which you do not want Skyram to generate requests. This flag takes precedence over --include if a FQDN is specified in both.

  • --runtime: Select the test runtime environment [Local, Docker, Kubernetes]

  • --output: Specify the name of the generated test file.

FQDNs need to be specified either as an exact path to the endpoint or in combination with a wildcard:

  • demoshop.skyramp.dev/products will only generate requests for POST and GET of the products endpoint

  • demoshop.skyramp.dev/products/* will also include all nested endpoints

For endpoints that require path parameters, please replace the path parameter with the wildcard:

  • Convert demoshop.skyramp.dev/products/{product_id}/reviews to demoshop.skyramp.dev/products/*/reviews

Execute your Test

You can execute the generated tests without any additional adjustments to the code.

Set env variable for authentication

Ensure proper authentication for test execution. By default, we expect a Bearer Token but support additional authentication methods. If your API does not require any authentication, you can skip this step and just run the test.

export SKYRAMP_TEST_TOKEN=$your_auth_token

Run the test

Since the Skyramp Demo Shop does not require authentication, you can immediately execute the generated test using Pytest:

python3 -m pytest integration_test.py

The test automatically identifies the relevant path parameters, intelligently chains the different requests together, and executes the test against the captured URLs

Reviewing Test Results

By default, Pytest provides clear and concise output indicating the success or failure of each step executed:

  • Each executed test will be displayed clearly in the terminal.

  • All encountered errors or issues will be neatly summarized for easy debugging at the end.

You can customize Pytest’s output to suit your team's preferences by following the Pytest documentation.

Next Steps

Congratulations on generating an integration test from traces! To learn more about the generated code, please visit the Integration Test Documentation describing the core concepts.

Let’s automate testing together!

Related topics

Installation

Skyramp Demo Shop

Integration Test

Python

Run the following command in your terminal to generate the integration test:

skyramp generate integration rest \
--language python \
--framework pytest \
--trace trace.json

Upon completion, Skyramp creates a fully executable Python test file (integration_test.py) that can be run immediately.

Explanation of Command

  • Compared to other commands, test generation from trace does not require a specified URL - we extract the various endpoints directly from the trace.

  • --language: Specifies the test output language.

  • --framework: Specify the test execution framework of choice.

  • --trace: Points to the Skyramp-collected trace used to generate the test. We extract all relevant scenario and request information directly from this file.

Additional Flags

Below are a few flags to customize the test generation. Additional flags are explained here.

  • --include: Specify a comma-separated list of FQDNs for Skyram to generate requests.

  • --exclude: Specify a comma-separated list of FQDNs for which you do not want Skyram to generate requests. This flag takes precedence over --include if a FQDN is specified in both.

  • --runtime: Select the test runtime environment [Local, Docker, Kubernetes]

  • --output: Specify the name of the generated test file.

FQDNs need to be specified either as an exact path to the endpoint or in combination with a wildcard:

  • demoshop.skyramp.dev/products will only generate requests for POST and GET of the products endpoint

  • demoshop.skyramp.dev/products/* will also include all nested endpoints

For endpoints that require path parameters, please replace the path parameter with the wildcard:

  • Convert demoshop.skyramp.dev/products/{product_id}/reviews to demoshop.skyramp.dev/products/*/reviews

Execute your Test

You can execute the generated tests without any additional adjustments to the code.

Set env variable for authentication

Ensure proper authentication for test execution. By default, we expect a Bearer Token but support additional authentication methods. If your API does not require any authentication, you can skip this step and just run the test.

export SKYRAMP_TEST_TOKEN=$your_auth_token

Run the test

Since the Skyramp Demo Shop does not require authentication, you can immediately execute the generated test using Pytest:

python3 -m pytest integration_test.py

The test automatically identifies the relevant path parameters, intelligently chains the different requests together, and executes the test against the captured URLs

Reviewing Test Results

By default, Pytest provides clear and concise output indicating the success or failure of each step executed:

  • Each executed test will be displayed clearly in the terminal.

  • All encountered errors or issues will be neatly summarized for easy debugging at the end.

You can customize Pytest’s output to suit your team's preferences by following the Pytest documentation.

Next Steps

Congratulations on generating an integration test from traces! To learn more about the generated code, please visit the Integration Test Documentation describing the core concepts.

Let’s automate testing together!

Related topics

Installation

Skyramp Demo Shop

Integration Test

© 2025 Skyramp, Inc. All rights reserved.

© 2025 Skyramp, Inc. All rights reserved.

© 2025 Skyramp, Inc. All rights reserved.