SBN

AWS CodeBuild Enhances CI with Parallel Test Execution and Merging

AWS CodeBuild has introduced a significant enhancement: parallel test execution. This feature dramatically reduces build times by enabling test suites to run concurrently across multiple compute environments. As projects grow more complex, lengthy test execution time in continuous integration pipelines has become a critical concern, affecting delivery speed, developer productivity, and costs.

With parallel test execution, developers can configure their builds to split test suites and run them across multiple independent build nodes. AWS CodeBuild offers environment variables for identifying the current node and total nodes, facilitating intelligent test distribution. The feature supports two main sharding strategies:

  • Equal distribution: Test files are sorted alphabetically and evenly distributed across parallel environments.
  • Stability: A consistent hashing algorithm ensures file-to-shard assignments remain stable despite changes in test files.

To enable this feature, developers must configure the batch fanout section in their buildspec.xml file, specifying the desired parallelism level. The codebuild-tests-run utility is pre-installed to manage test execution and sharding.

Parallel Test Execution

Image courtesy of AWS Documentation

A demonstration highlighted in an AWS blog post showed a reduction in total test time from 35 minutes to 6 minutes for a Python project with 1,800 tests when running on ten parallel compute environments. As noted by Sébastien Stormacq, a principal developer advocate at AWS, "The parallel run took 17.9 percent of the time of the sequential run."

The new capability is compatible with various testing frameworks, enhancing the development workflow.

AWS CodeBuild Supports Test Splitting and Parallelism

AWS CodeBuild enables test splitting across multiple, parallel-running compute environments. This means as the number of tests grows, utilizing multiple resources minimizes testing time in your CI/CD pipeline. Fast feedback cycles and improved developer productivity are essential in modern software development.

More details about the AWS Regions where CodeBuild is available can be found on the AWS Regions page. For comprehensive guidance on CodeBuild’s test splitting, visit the documentation or the AWS CodeBuild product page.

CodeBuild Merges Parallel Test Reports

AWS CodeBuild now supports automatic merging of test reports into a consolidated report when executing tests in parallel. This function enhances the visibility of results, allowing developers to receive comprehensive feedback quickly. By merging test results into a single report, CodeBuild delivers a more efficient analysis process.

This parallel testing feature is also available across all regions where CodeBuild is offered. For more information about this capability, check out the documentation and the AWS CodeBuild product page.

For organizations looking to enhance their authentication processes, integrating passwordless solutions can significantly improve user experience. MojoAuth offers seamless integration of passwordless authentication for web and mobile applications, ensuring a smooth, secure login experience for users. Explore how MojoAuth can elevate your security measures today.

*** This is a Security Bloggers Network syndicated blog from MojoAuth – Go Passwordless authored by Gopal Ghelot. Read the original post at: https://mojoauth.com/blog/aws-codebuild-enhances-ci-with-parallel-test-execution-and-merging/