You need to execute inline testing of an Azure DevOps pipeline that uses a Docker deployment model. The solution must prevent the results from being published to the pipeline. What should you use for the inline testing?
It should be C. a multi-stage Dockerfile
"Build and test with a multi-stage Dockerfile: build and tests execute inside the container using a multi-stage Docker file, as such test results are not published back to the pipeline."
https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=trx%2Cyaml
For Docker based apps there are many ways to build your application and run tests:
Build and test in a build pipeline: build and tests execute in the pipeline and test results are published using the Publish Test Results task.
Build and test with a multi-stage Dockerfile: build and tests execute inside the container using a multi-stage Docker file, as such test results are not published back to the pipeline.
Build, test, and publish results with a Dockerfile: build and tests execute inside the container and results are published back to the pipeline. See the example below.
--> So multi-stage docker file.
https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=trx%2Cyaml
The link, still provides a good argumentation for selecting C
https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/publish-test-results-v2?view=azure-pipelines&viewFallbackFrom=azure-devops&tabs=trx%2Ctrxattachments%2Cyaml#docker
Inline Testing Requirements:
The goal is to execute tests within the pipeline without impacting the final image or published test results.
We want to isolate the testing environment from the build process.
Separation of Concerns
No Test Result Publication
Build and test in a build pipeline: builds and tests execute in the pipeline and test results are published using the Publish Test Results task.
Build and test with a multi-stage Dockerfile: builds and tests execute inside the container using a multi-stage Docker file, as such test results are not published back to the pipeline.
Build, test, and publish results with a Dockerfile: builds and tests execute inside the container, and results are published back to the pipeline. See the example below.
https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/publish-test-results-v2?view=azure-pipelines&viewFallbackFrom=azure-devops&tabs=trx%2Ctrxattachments%2Cyaml#docker
Build and test in a build pipeline v/s
Build and test with a multi-stage Dockerfile: v/s
Build, test, and publish results with a Dockerfile:
So, Build and test with a multi-stage Dockerfile: satisfy this.
Multistage is right answer
"Build and test with a multi-stage Dockerfile: build and tests execute inside the container using a multi-stage Docker file, as such test results are not published back to the pipeline."
https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=trx%2Cyaml
IHOP, Answer is D, because the question mentions "Prevent the results from being published to the pipeline" if you need to publish results then it is multi-stage.
This section is not available anymore. Please use the main Exam Page.AZ-400 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
yhredil
Highly Voted 4 years, 6 months agoTealon
Highly Voted 4 years, 5 months agordemontis
3 years, 1 month agoGooldmember
Most Recent 6 months, 3 weeks agoFeriAZ
1 year, 2 months agovsvaid
1 year, 5 months agoObiWan500
1 year, 6 months agoyana_b
1 year, 7 months agoPamban
1 year, 11 months agorahul51it
2 years, 3 months agosyu31svc
2 years, 9 months agoManjubk
2 years, 10 months agoUnknowMan
3 years agoWhirly
3 years, 1 month agordemontis
3 years, 1 month agotatdatpham
3 years, 2 months agoWhirly
3 years, 2 months agoMev4953
3 years, 2 months ago