Recall & Review
beginner
What is the purpose of the test stage in a CI pipeline?
The test stage runs automated tests to check if the code works correctly before moving to the next steps. It helps catch errors early.
Click to reveal answer
beginner
Which tool is commonly used to run unit tests in Java projects during the CI test stage?
JUnit is a popular testing framework used to write and run unit tests in Java projects.
Click to reveal answer
intermediate
How does a CI pipeline know if the test stage passed or failed?
The CI pipeline checks the exit code of the test command. If tests pass, the exit code is zero; if any test fails, the exit code is non-zero, causing the pipeline to fail.
Click to reveal answer
beginner
What is a simple JUnit command to run tests in a Maven project during the CI test stage?
The command is
mvn test. It compiles the code and runs all tests defined with JUnit.Click to reveal answer
beginner
Why is it important to run tests automatically in the CI pipeline instead of manually?
Automatic tests run quickly and consistently on every code change, reducing human error and speeding up feedback to developers.
Click to reveal answer
What does the test stage in a CI pipeline primarily do?
✗ Incorrect
The test stage runs automated tests to verify the code works as expected before deployment.
Which command runs JUnit tests in a Maven project?
✗ Incorrect
The command 'mvn test' compiles the code and runs all tests including JUnit tests.
What happens if a test fails during the CI pipeline test stage?
✗ Incorrect
If any test fails, the pipeline stops and marks the build as failed to prevent bad code from progressing.
JUnit is used for which type of testing?
✗ Incorrect
JUnit is mainly used for unit testing small parts of code.
Why automate tests in the CI pipeline?
✗ Incorrect
Automated tests save time and provide quick feedback to catch errors early.
Explain the role of the test stage in a CI pipeline and how JUnit fits into it.
Think about how testing helps keep code safe before deployment.
You got /4 concepts.
Describe the command used to run JUnit tests in a Maven project and what happens if tests fail.
Focus on the command and pipeline behavior on test results.
You got /4 concepts.