This README provides an overview of an AWS Lambda-based testing framework using Taiko, Jest, and Chrome for running massively scalable tests in parallel. The framework is designed to allow thousands of tests to run simultaneously. It is structured using AWS Serverless Application Model (AWS SAM).
- Introduction
- AWS SAM Template
- Components
- Getting Started
- Scaling for Parallel Testing
- Contributing
- License
This AWS Lambda-based testing framework is designed to execute Jest and Taiko tests using a headless Chrome browser in parallel. This approach allows you to efficiently run a large number of tests simultaneously, making it suitable for mass-scale testing scenarios. The framework uses AWS Lambda functions and layers to manage dependencies efficiently.
The AWS SAM template defines the AWS resources required for the testing framework. Here's a simplified version of the template:
AWSTemplateFormatVersion: "2010-09-09"
Transform: "AWS::Serverless-2016-10-31"
Description: Sled Taiko Jest Chrome AWS Lambda
Resources:
SledTaikoJestFunction:
Type: "AWS::Serverless::Function"
Properties:
Handler: index.handler
Runtime: nodejs12.x
CodeUri: ./general/
Description: Sled sample project uses Taiko, Jest, and Chrome AWS Lambda
MemorySize: 824
Timeout: 60
Layers:
- SledChromiumLayer # Replace with actual layer name
ShopifyTaikoJestFunction:
Type: "AWS::Serverless::Function"
Properties:
Handler: index.handler
Runtime: nodejs12.x
CodeUri: ./shopify/
Description: Sled sample project uses Taiko, Jest, and Chrome AWS Lambda
MemorySize: 824
Timeout: 240
Layers:
- ShopifyTestLayer # Replace with actual layer name
This template defines two Lambda functions for different test suites, each with its respective code and dependencies.
-
SledTaikoJestFunction: This Lambda function runs Jest and Taiko tests using a headless Chrome browser. It is configured with specific memory and timeout settings.
-
ShopifyTaikoJestFunction: Similar to the first function but designed for running Jest and Taiko tests specific to Shopify.
The Lambda layers include the necessary dependencies for the testing framework:
-
SledChromiumLayer: This layer provides the Chromium browser, allowing headless Chrome execution.
-
JestTaikoLayer: This layer contains the Taiko and Jest dependencies, enabling the execution of the tests.
-
ShopifyTestLayer: This layer includes dependencies required for Shopify-specific testing scenarios.
To use this testing framework, follow these steps:
- Clone the repository containing your testing code and AWS SAM template.
- Modify the template to define your AWS resources and dependencies.
- Deploy the AWS SAM application using the SAM CLI or AWS CloudFormation.
- Upload your testing code to the Lambda functions.
To enable massive scaling for parallel testing, you can configure AWS Lambda to run multiple instances of your functions concurrently. You can adjust the Concurrency
setting in the AWS Lambda console or use an autoscaling mechanism based on your specific testing needs.
If you'd like to contribute to this framework or have suggestions for improvements, please submit a pull request or open an issue on the project's GitHub repository.
This testing framework is open source and available under the MIT License. See the LICENSE file for more details.
Feel free to customize and extend this framework to meet your specific testing requirements. Happy testing!