Automation Testing CI/CD and DevOps Integration 1 — Questions and Answers
Question 1: What does CI stand for in a CI/CD pipeline for test automation?
- Continuous Integration (Correct answer)
- Continuous Inspection
- Code Integration
- Continuous Implementation
Correct answer: Continuous Integration
CI stands for Continuous Integration, the practice of automatically building and testing code every time a change is committed.
Question 2: Which Jenkins file type defines a pipeline as code using Groovy syntax?
- Jenkinsfile (Correct answer)
- pipeline.xml
- build.gradle
- ci.yml
Correct answer: Jenkinsfile
A Jenkinsfile defines the entire Jenkins pipeline as code using declarative or scripted Groovy DSL, stored in version control.
Question 3: In GitHub Actions, what triggers an automated test workflow on every pull request?
- on: pull_request event in the workflow YAML (Correct answer)
- A cron job schedule
- A webhook plugin
- A shell script in the repo root
Correct answer: on: pull_request event in the workflow YAML
Adding `on: pull_request` in the GitHub Actions workflow YAML file triggers the workflow whenever a pull request is opened or updated.
Question 4: What is the purpose of a build artifact in a CI/CD pipeline?
- A file produced by the build process (like test reports or binaries) that can be stored and passed between stages (Correct answer)
- A build error log
- A Docker image tag
- A dependency lock file
Correct answer: A file produced by the build process (like test reports or binaries) that can be stored and passed between stages
Build artifacts are outputs (compiled code, test reports, packages) that are archived after a CI stage and can be used in subsequent pipeline stages.
Question 5: What does 'shift-left testing' mean in a DevOps context?
- Running tests earlier in the development lifecycle (Correct answer)
- Moving tests to a different server
- Running tests after deployment only
- Shifting responsibility to QA
Correct answer: Running tests earlier in the development lifecycle
Shift-left testing moves testing activities earlier (to the left on a timeline) in the software development lifecycle to catch defects sooner.
Question 6: Which CI/CD tool uses .gitlab-ci.yml to define automated pipeline jobs?
- GitLab CI/CD (Correct answer)
- Jenkins
- GitHub Actions
- CircleCI
Correct answer: GitLab CI/CD
GitLab CI/CD reads pipeline configuration from a .gitlab-ci.yml file in the repository root to define stages and jobs.
What does CI stand for in a CI/CD pipeline for test automation?