Optimize Django and pytest-django test execution in CI with cache configuration, slow-test splitting, database reuse strategy, parallel workers, pytest-xdist, CircleCI/GitHub Actions/Jenkins/Travis patterns, and full-coverage safeguards.
SkillScore92Maintained
Automatic
◆DevOps & SRE pack
Last verified 8/15/2026
What it changes
Passed 22 of 24 test cases with the skill, and 20 of 24 without it.
Without skill83%
With skill92%
Checks it passed that the model alone missed
Requires at least one CI execution path that executes full database migrations
Requires a serial fallback command for debugging failed parallelized test runs
Requires providing a command to execute the test suite in single-threaded serial mode for debugging
and 1 more in the full report
3 fixed19 passed either way1 still failing1 broke
Pass-rate lift
+8 pp
Tokens
-6%
Agent turns
0%
Response time
-29%
Model gemini-3.6-flashMeasured 8/15/2026v122 of 24 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 3
Prompt
When a flaky test failure occurs on a 4-worker parallelized test runner in CI, what fallback mechanism must be available for developers to investigate the failure?
What was checked, without and with the skill
Checked
Without skill
With skill
Requires providing a command to execute the test suite in single-threaded serial mode for debugging
Missed
Passed
case-20 · gemini-3.6-flash · 8/15/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md55 lines2 files
Django CI Test Optimization
CI optimization should reduce feedback time without reducing confidence. Keep fast local commands and full CI coverage distinct, then make the CI path faster with caching, parallelism, and sensible split points.
CI Workflow
Capture current CI timing.
Separate dependency install, test database setup, test execution, and artifact upload.
Compare CI time with local wall-clock time to spot environment-only overhead.
Cache dependencies first.
Use CI-native cache primitives for pip or package-manager caches.
Cache the package download cache, not an unsafe mutable virtualenv unless the project already supports that pattern.
Keep local shortcuts honest.
Local runs may skip slow tests or reuse databases.
CI should run slow tests and at least one migration-realistic database setup path.
Split tests deliberately.
Split slow vs normal tests when slow markers are meaningful.
Use parallel workers after the suite is safe under django-test-parallelization.
Avoid duplicating expensive setup across too many shards.
Scale hardware only after obvious waste is removed.
Faster runners can be the pragmatic answer, but they hide inefficient setup when used too early.
Read ci-patterns.md for command and configuration patterns.
Decision Rules
Cache dependency downloads before rewriting test code for CI-only speed.
Register pytest marks strictly so slow typos do not silently change coverage.
If local commands exclude slow tests, add a CI job that includes them.
If using no-migration local shortcuts, add a CI path that runs real migrations.
Split by tags when test categories are intentionally different; split by workers when the suite is homogeneous enough.