Skip to content

test - CLI Testing Utilities

The test command runs tests for the Nixopus CLI in development environments. This command is restricted to development environments only.

Quick Start

bash
# Set development environment (required)
export ENV=DEVELOPMENT

# Run all tests
nixopus test

# Run specific test target
nixopus test version

Overview

The test command provides basic testing capabilities for the Nixopus CLI. It requires the ENV=DEVELOPMENT environment variable to prevent accidental execution in production.

Command Syntax

bash
nixopus test [TARGET]
ArgumentDescriptionRequired
TARGETSpecific test target (e.g., version)No

Examples:

bash
# Set development environment first (required)
export ENV=DEVELOPMENT

# Run all tests
nixopus test

# Run specific command tests
nixopus test version

Configuration

The test command does not use external configuration files. It operates with environment variable requirements.

Environment Requirements

SettingRequired ValueDescription
ENVDEVELOPMENTMust be set to enable testing

Configuration Source

The test command requires the ENV=DEVELOPMENT environment variable to be set:

bash
# Required environment setup
export ENV=DEVELOPMENT

Overriding Configuration

You can specify different test targets using the command argument:

bash
# Test specific command
nixopus test version

# Test different command
nixopus test install

Error Handling

Common error scenarios and solutions:

ErrorCauseSolution
Environment not developmentENV not set to DEVELOPMENTSet export ENV=DEVELOPMENT
Test dependencies missingDevelopment packages not installedInstall with poetry install --with dev
Permission deniedFile system permissionsUse sudo if necessary

If permission issues occur, use sudo:

bash
sudo nixopus test
  • version - Check CLI version before running tests
  • preflight - Validate test environment setup

Made with love
Released under the Functional Source License (FSL)