run-tests

Run NetBox Django tests via manage.py with testing configuration.

21.3k|3.1k|Updated Feb 29, 2016
One-click install
npx skills add https://github.com/netbox-community/netbox --skill run-tests-netbox-community
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: run-tests
Source: https://github.com/netbox-community/netbox/tree/main/.claude/skills/run-tests
Command: npx skills add https://github.com/netbox-community/netbox --skill run-tests-netbox-community

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Running NetBox’s Django test suite locally can be slow or error-prone because it depends on specific configuration, database/redis services, and the correct Django test runner behavior.

Core Features & Use Cases

  • Run the full NetBox Django test suite using the same invocation that CI uses, so local results match pull request expectations.
  • Target specific app or Django test targets (app, module, class, method) to quickly validate the area you changed.
  • Use safe test-run options such as parallel execution, fail-fast behavior, and incremental DB reuse for iterative development.

Quick Start

Run the NetBox Django tests from the repository root with the test configuration enabled by setting NETBOX_CONFIGURATION=netbox.configuration_testing and executing netbox/manage.py test netbox/ --parallel.

Frequently Asked Questions about run-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Django tests for NetBox to match CI behavior locally?

Run the NetBox Django test suite locally by executing netbox/manage.py test with NETBOX_CONFIGURATION set to netbox.configuration_testing to ensure your results match CI expectations before opening a pull request.

Can I target specific Django test modules or classes instead of the full NetBox suite?

Yes, you can run focused validations by specifying app, module, class, or method targets with manage.py test, allowing you to quickly validate only the specific area of NetBox code you changed.

Does NetBox support parallel test execution to speed up the Django test suite?

Yes, NetBox supports parallel execution by passing the --parallel flag to manage.py test, matching the behavior of the .github workflow to reduce overall test run time.

Why do my local NetBox Django tests fail or behave differently from CI?

Local NetBox tests often fail without the correct test runner configuration; setting NETBOX_CONFIGURATION to the testing configuration and ensuring required database and redis services are running resolves CI parity issues.

What configuration environment is required to run NetBox Django tests?

Running NetBox Django tests requires setting the NETBOX_CONFIGURATION environment variable to netbox.configuration_testing and having the necessary database and redis services available for the test runner.

Are there safe test-run options for iterative NetBox Django development?

Yes, you can use safe test-run options like parallel execution, fail-fast behavior, and incremental database reuse with manage.py test to speed up iterative NetBox development cycles.