integrationtest

package
v0.0.0-...-5b20b62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2025 License: EUPL-1.2 Imports: 13 Imported by: 0

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

func DefaultConfig() config.Config

DefaultConfig returns a sensible default configuration for testing.

func GitRepo

func GitRepo(t *testing.T, commits ...string) (string, func())

GitRepo creates a test repository with specified commit messages. Returns the repository path and a cleanup function.

func WithRules

func WithRules(rules ...string) config.Config

WithRules returns a config with only the specified rules enabled.

func WithSubjectMaxLength

func WithSubjectMaxLength(length int) config.Config

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

func TestValidateMessage(t *testing.T, message string, config config.Config) ValidationResult

TestValidateMessage validates a commit message directly without requiring a git repository.

func TestValidation

func TestValidation(t *testing.T, repoPath string, config config.Config) ValidationResult

TestValidation provides a simple interface for testing validation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL