300-910 · Question #88
Refer to the exhibit. A development team is implementing a CI/CD pipeline to deploy a microservices application in a Kubernetes cluster. Which two tests must be added to the Build and Test phases? (Ch
The correct answer is A. Run the integration test in the Test phase. B. Run the unit test in the Build phase.. For a microservices CI/CD pipeline, unit tests should be executed early in the Build phase to quickly catch code defects, while integration tests are run in the subsequent Test phase to verify component interactions.
Question
Exhibit
Options
- ARun the integration test in the Test phase.
- BRun the unit test in the Build phase.
- CRun the performance test in the Test phase.
- DRun the unit test in the Test phase.
- ERun the integration test in the Build phase.
How the community answered
(29 responses)- A83% (24)
- C3% (1)
- D3% (1)
- E10% (3)
Why each option
For a microservices CI/CD pipeline, unit tests should be executed early in the Build phase to quickly catch code defects, while integration tests are run in the subsequent Test phase to verify component interactions.
Integration tests verify the interactions between multiple components or microservices and external dependencies. These tests are typically more comprehensive and time-consuming than unit tests, making the dedicated Test phase an appropriate stage to execute them after individual components have been built and initially verified.
Unit tests focus on validating individual units of code, such as functions or methods, in isolation. Running unit tests in the Build phase provides immediate feedback on the correctness and quality of newly developed code, allowing for rapid detection and resolution of issues before proceeding to more complex testing stages.
Performance tests are typically conducted in later stages of the pipeline or in dedicated testing environments to evaluate system behavior under load, rather than being a primary component of the standard Build or Test phases for functional correctness.
While unit tests are critical, best practice dictates running them as early as possible in the pipeline, ideally during the Build phase, to ensure a 'fail fast' approach and provide developers with quick feedback.
Integration tests are more complex and resource-intensive, requiring multiple components to be available. Running them in the Build phase would unnecessarily slow down the build process and is not the typical placement in an optimized CI/CD pipeline.
Concept tested: CI/CD pipeline testing phases
Source: https://learn.microsoft.com/en-us/azure/devops/pipelines/test/types-of-tests?view=azure-devops
Topics
Community Discussion
No community discussion yet for this question.
