Documentation
¶
Overview ¶
Package integrationtest contains end-to-end integration tests for gommitlint workflows.
These tests verify that the application's components work together correctly in realistic scenarios. They test complete workflows including:
- CLI command execution
- Configuration loading
- Git repository operations
- Validation rule execution
- Output formatting
Test Organization ¶
- branch_comparison_test.go: Tests branch comparison functionality
- cli_workflow_test.go: Tests the CLI validate command end-to-end
- comprehensive_test.go: Tests comprehensive validation scenarios
- context_config_test.go: Tests context-based configuration workflow
- crypto_workflow_test.go: Tests cryptographic verification workflows
- rulepriority_integration_test.go: Tests rule priority system
- validation_workflow_test.go: Tests core validation workflow
Important Notes ¶
THIS PACKAGE CONTAINS TEST-ONLY CODE AND SHOULD NOT BE IMPORTED BY PRODUCTION CODE.
Integration tests are automatically skipped in environments without Git. The tests check for git availability using the git command.
These tests create temporary Git repositories and configuration files to test real-world scenarios.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶
DefaultConfig returns a sensible default configuration for testing.
func GitRepo ¶
GitRepo creates a test repository with specified commit messages. Returns the repository path and a cleanup function.
func WithSubjectMaxLength ¶
WithSubjectMaxLength returns a config with custom subject max length.
Types ¶
type ValidationResult ¶
type ValidationResult struct {
Valid bool
Errors []domain.ValidationError
}
ValidationResult represents the result of a validation operation.
func TestValidateMessage ¶
TestValidateMessage validates a commit message directly without requiring a git repository.
func TestValidation ¶
TestValidation provides a simple interface for testing validation.