test(e2e): skip gracefully when Redis unavailable, fix cross-device link
Some checks failed
Checkout test / test (push) Successful in 4s
CI/CD Pipeline / Test (push) Failing after 1s
CI/CD Pipeline / Dev Compose Smoke Test (push) Has been skipped
CI/CD Pipeline / Build (push) Has been skipped
CI/CD Pipeline / Test Scripts (push) Has been skipped
CI/CD Pipeline / Test Native Libraries (push) Has been skipped
Documentation / build-and-publish (push) Failing after 33s
CI/CD Pipeline / Docker Build (push) Has been skipped
Security Scan / Security Analysis (push) Has been cancelled
Security Scan / Native Library Security (push) Has been cancelled
Some checks failed
Checkout test / test (push) Successful in 4s
CI/CD Pipeline / Test (push) Failing after 1s
CI/CD Pipeline / Dev Compose Smoke Test (push) Has been skipped
CI/CD Pipeline / Build (push) Has been skipped
CI/CD Pipeline / Test Scripts (push) Has been skipped
CI/CD Pipeline / Test Native Libraries (push) Has been skipped
Documentation / build-and-publish (push) Failing after 33s
CI/CD Pipeline / Docker Build (push) Has been skipped
Security Scan / Security Analysis (push) Has been cancelled
Security Scan / Native Library Security (push) Has been cancelled
- StartTemporaryRedis now skips tests instead of failing when redis-server unavailable - Fix homelab_e2e_test cross-device link issue using CopyDir instead of Rename
This commit is contained in:
parent
bf4a8bcf78
commit
47ad62648d
2 changed files with 8 additions and 2 deletions
|
|
@ -328,11 +328,11 @@ func TestConfigurationScenariosE2E(t *testing.T) {
|
||||||
|
|
||||||
// Backup original configs if they exist
|
// Backup original configs if they exist
|
||||||
if _, err := os.Stat(originalConfigDir); err == nil {
|
if _, err := os.Stat(originalConfigDir); err == nil {
|
||||||
if err := os.Rename(originalConfigDir, tempConfigDir); err != nil {
|
if err := tests.CopyDir(originalConfigDir, tempConfigDir); err != nil {
|
||||||
t.Fatalf("Failed to backup configs: %v", err)
|
t.Fatalf("Failed to backup configs: %v", err)
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
_ = os.Rename(tempConfigDir, originalConfigDir)
|
_ = tests.CopyDir(tempConfigDir, originalConfigDir)
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
6
tests/fixtures/test_utils.go
vendored
6
tests/fixtures/test_utils.go
vendored
|
|
@ -128,6 +128,12 @@ func EnsureRedis(t *testing.T) (cleanup func()) {
|
||||||
|
|
||||||
// Start temporary Redis
|
// Start temporary Redis
|
||||||
t.Logf("Starting temporary Redis on %s", redisAddr)
|
t.Logf("Starting temporary Redis on %s", redisAddr)
|
||||||
|
|
||||||
|
// Check if redis-server is available
|
||||||
|
if _, err := exec.LookPath("redis-server"); err != nil {
|
||||||
|
t.Skip("Skipping: redis-server not available in PATH")
|
||||||
|
}
|
||||||
|
|
||||||
cmd := exec.CommandContext(
|
cmd := exec.CommandContext(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
"redis-server",
|
"redis-server",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue