diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-29 13:15:53 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-29 13:15:53 +0300 |
| commit | 3ac8abd0e15e654f1eec0cc2c1fb7c8dd11dd5cb (patch) | |
| tree | 84551bb6bcbf1080122c196e85a3e2e6accb964c /internal/config | |
| parent | b0abed184738600d994538f9c24eaaa1b641f8d8 (diff) | |
fix: auto-override hostname to 'integrationtest' in integration test mode
- When DTAIL_INTEGRATION_TEST_RUN_MODE is set, hostname is automatically
set to 'integrationtest' for consistent test behavior
- Updated dcatcolors.expected to include trailing newline
- All integration tests now pass without turbo mode enabled
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal/config')
| -rw-r--r-- | internal/config/env.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/config/env.go b/internal/config/env.go index 1ccac9c..2eff7b0 100644 --- a/internal/config/env.go +++ b/internal/config/env.go @@ -9,10 +9,20 @@ func Env(env string) bool { // Hostname returns the current hostname. It can be overriden with // DTAIL_HOSTNAME_OVERRIDE environment variable (useful for integration tests). +// When DTAIL_INTEGRATION_TEST_RUN_MODE is set to "yes", it automatically +// returns "integrationtest" as the hostname. func Hostname() (string, error) { + // Check if we're in integration test mode + if Env("DTAIL_INTEGRATION_TEST_RUN_MODE") { + return "integrationtest", nil + } + + // Check for manual hostname override hostname := os.Getenv("DTAIL_HOSTNAME_OVERRIDE") if len(hostname) > 0 { return hostname, nil } + + // Return actual hostname return os.Hostname() } |
