chore(tests): enhance output
All checks were successful
Go-Tests / tests (push) Successful in 2m18s
Go-Tests / sonar (push) Successful in 55s

- use a better logger separation
- use tags not not overload the CI output
- removed lot of log.Println/Fatal/Error
This commit is contained in:
2025-09-15 13:02:54 +02:00
parent 9472952d65
commit debe43ce34
14 changed files with 106 additions and 77 deletions

View File

@@ -1,7 +1,6 @@
package katenaryfile
import (
"log"
"os"
"path/filepath"
"testing"
@@ -39,18 +38,15 @@ webapp:
composeFile := filepath.Join(tmpDir, "compose.yaml")
katenaryFile := filepath.Join(tmpDir, "katenary.yaml")
os.MkdirAll(tmpDir, 0755)
if err := os.WriteFile(composeFile, []byte(composeContent), 0644); err != nil {
os.MkdirAll(tmpDir, 0o755)
if err := os.WriteFile(composeFile, []byte(composeContent), 0o644); err != nil {
t.Log(err)
}
if err := os.WriteFile(katenaryFile, []byte(katenaryfileContent), 0644); err != nil {
if err := os.WriteFile(katenaryFile, []byte(katenaryfileContent), 0o644); err != nil {
t.Log(err)
}
defer os.RemoveAll(tmpDir)
c, _ := os.ReadFile(composeFile)
log.Println(string(c))
// chand dir to this directory
os.Chdir(tmpDir)
options, _ := cli.NewProjectOptions(nil,
@@ -92,18 +88,15 @@ webapp:
composeFile := filepath.Join(tmpDir, "compose.yaml")
katenaryFile := filepath.Join(tmpDir, "katenary.yaml")
os.MkdirAll(tmpDir, 0755)
if err := os.WriteFile(composeFile, []byte(composeContent), 0644); err != nil {
os.MkdirAll(tmpDir, 0o755)
if err := os.WriteFile(composeFile, []byte(composeContent), 0o644); err != nil {
t.Log(err)
}
if err := os.WriteFile(katenaryFile, []byte(katenaryfileContent), 0644); err != nil {
if err := os.WriteFile(katenaryFile, []byte(katenaryfileContent), 0o644); err != nil {
t.Log(err)
}
defer os.RemoveAll(tmpDir)
c, _ := os.ReadFile(composeFile)
log.Println(string(c))
// chand dir to this directory
os.Chdir(tmpDir)
options, _ := cli.NewProjectOptions(nil,
@@ -150,18 +143,15 @@ webapp:
composeFile := filepath.Join(tmpDir, "compose.yaml")
katenaryFile := filepath.Join(tmpDir, "katenary.yaml")
os.MkdirAll(tmpDir, 0755)
if err := os.WriteFile(composeFile, []byte(composeContent), 0644); err != nil {
os.MkdirAll(tmpDir, 0o755)
if err := os.WriteFile(composeFile, []byte(composeContent), 0o644); err != nil {
t.Log(err)
}
if err := os.WriteFile(katenaryFile, []byte(katenaryfileContent), 0644); err != nil {
if err := os.WriteFile(katenaryFile, []byte(katenaryfileContent), 0o644); err != nil {
t.Log(err)
}
defer os.RemoveAll(tmpDir)
c, _ := os.ReadFile(composeFile)
log.Println(string(c))
// chand dir to this directory
os.Chdir(tmpDir)
options, _ := cli.NewProjectOptions(nil,