Skip to content

Commit

Permalink
test: Add new units tests to improve coverage
Browse files Browse the repository at this point in the history
* Remove -race flag from build args as it can have large impact on perf

Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com>
  • Loading branch information
mahendrapaipuri committed Jun 24, 2024
1 parent 18326f3 commit 7e98536
Show file tree
Hide file tree
Showing 10 changed files with 852 additions and 299 deletions.
2 changes: 1 addition & 1 deletion .promu-cgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build:
path: ./cmd/ceems_lb
tags:
all: [osusergo, netgo, static_build]
flags: -a -race
flags: -a
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
Expand Down
8 changes: 7 additions & 1 deletion pkg/api/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net/http"
"os"
"path/filepath"
"syscall"
"testing"
"time"

Expand Down Expand Up @@ -104,7 +105,8 @@ func TestCEEMSServerMain(t *testing.T) {
---
ceems_api_server:
data:
path: %s`
path: %[1]s
backup_path: %[1]s`

configFile := fmt.Sprintf(configFileTmpl, dataDir)
configFilePath := makeConfigFile(configFile, tmpDir)
Expand All @@ -131,4 +133,8 @@ ceems_api_server:
t.Errorf("Could not start stats server after %d attempts", i)
}
}

// Send INT signal and wait a second to clean up server and DB
syscall.Kill(syscall.Getpid(), syscall.SIGINT)
time.Sleep(1 * time.Second)
}
Loading

0 comments on commit 7e98536

Please sign in to comment.