forked from opendevstack/ods-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify-ods-namespace-ocp_test.go
55 lines (47 loc) · 1.61 KB
/
verify-ods-namespace-ocp_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package ods_verify
import (
"path"
"runtime"
"testing"
"github.com/opendevstack/ods-core/tests/utils"
"github.com/opendevstack/ods-core/tests/validate"
)
func TestVerifyOdsNamespaceJenkinsOcpConfig(t *testing.T) {
_, filename, _, _ := runtime.Caller(0)
dir := path.Join(path.Dir(filename), "..", "..", "jenkins", "ocp-config", "build")
tailorOcpConfigNoDiffs(dir, t)
}
func TestVerifyOdsNamespaceSonarqubeOcpConfig(t *testing.T) {
_, filename, _, _ := runtime.Caller(0)
dir := path.Join(path.Dir(filename), "..", "..", "sonarqube", "ocp-config")
tailorOcpConfigNoDiffs(dir, t)
}
func TestVerifyOdsNamespaceNexusOcpConfig(t *testing.T) {
_, filename, _, _ := runtime.Caller(0)
dir := path.Join(path.Dir(filename), "..", "..", "nexus", "ocp-config")
tailorOcpConfigNoDiffs(dir, t)
}
func TestVerifyOdsNamespaceDocGenSvcOcpConfig(t *testing.T) {
_, filename, _, _ := runtime.Caller(0)
dir := path.Join(path.Dir(filename), "..", "..", "ods-document-generation-svc", "ocp-config")
tailorOcpConfigNoDiffs(dir, t)
}
func TestVerifyOdsNamespaceProvAppOcpConfig(t *testing.T) {
_, filename, _, _ := runtime.Caller(0)
dir := path.Join(path.Dir(filename), "..", "..", "ods-provisioning-app", "ocp-config")
tailorOcpConfigNoDiffs(dir, t)
}
func tailorOcpConfigNoDiffs(dir string, t *testing.T) {
odsNamespace := validate.OdsCoreEnvVariableOrFail(t, validate.ODS_NAMESPACE)
stdout, stderr, err := utils.RunCommandWithWorkDir("tailor", []string{
"-n", odsNamespace,
"diff",
"--reveal-secrets",
}, dir, []string{})
if err != nil {
t.Fatalf(
"Execution of tailor failed: \nStdOut: %s\nStdErr: %s",
stdout,
stderr)
}
}