CI tests are standardized evidence

Local tests provide fast feedback, while CI repeats key assumptions in a clean standardized environment. A backend job may combine unit or service tests, integration or API checks, JAR build, and a health-endpoint smoke check.

Task names and test services depend on the project. The workflow should use the same basic commands as README and local development.

LayerExample signal
Unit or serviceLocal business logic and rules
Integration or APIService, database, configuration, and contract interaction
BuildCompilation, dependencies, and packaging
SmokeStart and health endpoint
FrontendInstall with lock file, tests, build, and short start

How to read a red job

  1. Find the step that failed.
  2. Locate the first meaningful error message.
  3. Separate the primary error from cascading messages.
  4. Compare the failure with changed files and job configuration.
  5. Repeat only the related job after the smallest fix.

Failure classification

A failing test does not automatically prove that the product is broken. The behavior may have changed intentionally while the test remained old. Compare the assertion with the business rule and log evidence.

CategorySignsFirst direction
codeException, wrong response, or wrong resultChanged code and its contract
testOutdated or incorrect expectationTest alignment with the business rule
environmentPort, service, or environment is missingRuntime and job configuration
dependencynpm or Gradle, lock file, or incompatible versionDependencies and wrapper
flakyUnstable result without a code changeRepeatability and run history
infrastructure or permissionsRunner, network, timeout, or access issueCI state and permissions

Claude as diagnostician, not automatic repairer

  1. Pass only the relevant log and changed-file list.
  2. Ask Claude to distinguish symptom, hypothesis, and confirmed fact.
  3. Check the hypothesis locally or with a narrow rerun.
  4. Make the smallest fix after confirmation.
  5. Do not accept an AI conclusion without primary evidence.
Bounded prompt for CI failure analysis
Input: failing job log and changed-file list
Return:
- failure category
- probable root cause
- evidence from the log
- smallest verification command
- next action
Do not edit files, disable tests, or hide the failure.

Flaky tests, reruns, and evidence

One successful rerun does not prove that a problem disappeared; it only shows that the test can pass unstably. Record frequency, conditions, logs, and the deliberate decision to isolate or fix the cause.

Temporarily disabling a test makes a pipeline green while removing a regression signal. Classify the cause as code, test, environment, dependency, flaky, or infrastructure instead.

EventEvidence to record
Failed jobStep name, first error, command, and commit context
HypothesisWhy it explains the symptom
Smallest fixChanged files and non-goals
Repeat checkThe same scenario and actual result
Flaky signalSeveral runs, conditions, and follow-up decision

Canonical lesson source · JavaRush

Open JavaRush material