Tests need secrets (API keys for a sandbox). How do you provide them safely in CI?
IntermediateScenarioBuilds, Artifacts, Nexus, SonarQube and Testing
Answer
Situation read → Test-time secrets.
What I'd do →
- Use dedicated sandbox keys with minimal scope and a rotation schedule.
- Inject at runtime through the CI secret store/Vault, not committed
.envfiles. - Block secret availability on fork PRs.
- Prefer mocks or contract tests where the real service is not needed.
Why → Test credentials are still credentials and still leak.
Interview tip → Contract tests (Pact) reduce reliance on live third parties.
More on Builds, Artifacts, Nexus, SonarQube and Testing
A Maven project resolves dependencies from Maven Central on every build and a left-pad style outage would stop all builds.BeginnerYou must publish snapshot and release artifacts without overwriting a released version.IntermediateEvery merge to main should produce a unique semantic version automatically.IntermediateAn npm build is non-reproducible: different versions install on different days.BeginnerThe SonarQube quality gate must block merging PRs that add new bugs, vulnerabilities or uncovered code.IntermediateCoverage shows 0% in SonarQube although tests run in CI.Intermediate