Automation Testing CI/CD and DevOps Integration 2 — Questions and Answers
Question 1: What is a Docker container's primary benefit for test automation environments?
- Provides consistent, isolated environments that eliminate 'works on my machine' issues (Correct answer)
- Speeds up test script writing
- Generates test data automatically
- Manages browser licensing
Correct answer: Provides consistent, isolated environments that eliminate 'works on my machine' issues
Docker containers package the application and all dependencies together, ensuring tests run in identical environments across all machines.
Question 2: In a CI pipeline, what is a 'gate' or 'quality gate'?
- A threshold that must be met (e.g., test pass rate) before a pipeline stage proceeds (Correct answer)
- A firewall rule
- A deployment approval button
- A merge conflict check
Correct answer: A threshold that must be met (e.g., test pass rate) before a pipeline stage proceeds
A quality gate is a pass/fail threshold (like minimum test coverage or zero critical failures) that stops the pipeline if not met.
Question 3: What does 'parallel test execution' achieve in a CI/CD pipeline?
- Reduces total test suite runtime by running multiple tests simultaneously (Correct answer)
- Increases test accuracy
- Eliminates flaky tests
- Generates more test reports
Correct answer: Reduces total test suite runtime by running multiple tests simultaneously
Parallel execution splits tests across multiple agents/threads running simultaneously, dramatically reducing overall pipeline duration.
Question 4: Which environment variable approach is recommended for storing sensitive test credentials in CI/CD?
- CI/CD platform secret variables or a secrets manager (Correct answer)
- Hard-coding in the test script
- Storing in a plain text config file
- Storing in a public repository
Correct answer: CI/CD platform secret variables or a secrets manager
CI/CD platforms provide secret/masked environment variables that are injected at runtime without exposing credentials in code or logs.
Question 5: What is the purpose of a smoke test in a CI/CD deployment pipeline?
- A quick sanity check verifying critical functionality works after deployment before running full regression (Correct answer)
- A test for memory leaks
- A performance benchmark
- A security vulnerability scan
Correct answer: A quick sanity check verifying critical functionality works after deployment before running full regression
Smoke tests are fast, high-level tests run immediately after deployment to verify the build is stable enough for further testing.
Question 6: In GitLab CI, what keyword defines the sequence of execution phases in a pipeline?
- stages (Correct answer)
- jobs
- scripts
- phases
Correct answer: stages
The `stages` keyword in .gitlab-ci.yml defines the ordered list of pipeline phases; jobs within each stage run in parallel.
What is a Docker container's primary benefit for test automation environments?