Skip to content

Commit 31682ef

Browse files
committed
rename script name, and some minor fix
1 parent 320c966 commit 31682ef

File tree

5 files changed

+45
-38
lines changed

5 files changed

+45
-38
lines changed

cmd/openshift-tests/openshift-tests.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
collectdiskcertificates "github.com/openshift/origin/pkg/cmd/openshift-tests/collect-disk-certificates"
2323
"github.com/openshift/origin/pkg/cmd/openshift-tests/dev"
2424
"github.com/openshift/origin/pkg/cmd/openshift-tests/disruption"
25-
cluster_health_check "github.com/openshift/origin/pkg/cmd/openshift-tests/health-check"
25+
e2e_analysis "github.com/openshift/origin/pkg/cmd/openshift-tests/e2e-analysis"
2626
"github.com/openshift/origin/pkg/cmd/openshift-tests/images"
2727
"github.com/openshift/origin/pkg/cmd/openshift-tests/list"
2828
"github.com/openshift/origin/pkg/cmd/openshift-tests/monitor"
@@ -101,7 +101,7 @@ func main() {
101101
monitor.NewMonitorCommand(ioStreams),
102102
disruption.NewDisruptionCommand(ioStreams),
103103
risk_analysis.NewTestFailureRiskAnalysisCommand(),
104-
cluster_health_check.NewTestFailureClusterHealthCheckCommand(),
104+
e2e_analysis.NewTestFailureClusterAnalysisCheckCommand(),
105105
run_resource_watch.NewRunResourceWatchCommand(),
106106
timeline.NewTimelineCommand(ioStreams),
107107
run_disruption.NewRunInClusterDisruptionMonitorCommand(ioStreams),
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package e2e_analysis
2+
3+
import (
4+
e2eanalysis "github.com/openshift/origin/pkg/e2eanalysis"
5+
"github.com/spf13/cobra"
6+
"k8s.io/kubectl/pkg/util/templates"
7+
)
8+
9+
func NewTestFailureClusterAnalysisCheckCommand() *cobra.Command {
10+
e2eAnalysisOpts := &e2eanalysis.Options{}
11+
12+
cmd := &cobra.Command{
13+
Use: "e2e-analysis",
14+
Short: "Performs analysis against the cluster",
15+
Long: templates.LongDesc(`
16+
Check cluster health and run some e2e analyisis, including:
17+
all machines should be in Running state;
18+
all nodes should be ready;
19+
ready node count should match or exceed running machine count;
20+
operators health ordered by dependency;
21+
and so on.`),
22+
RunE: func(cmd *cobra.Command, args []string) error {
23+
return e2eAnalysisOpts.Run()
24+
},
25+
}
26+
cmd.Flags().StringVar(&e2eAnalysisOpts.JUnitDir,
27+
"junit-dir", e2eAnalysisOpts.JUnitDir,
28+
"The directory where test reports were written in junit xml format.")
29+
30+
return cmd
31+
}

pkg/cmd/openshift-tests/health-check/command.go

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package health_check
1+
package e2e_analysis
22

33
import (
44
"context"
@@ -29,7 +29,7 @@ type Options struct {
2929
JUnitDir string
3030
}
3131

32-
// Konwn dependency mapping
32+
// Known dependency mapping
3333
// key: operator name
3434
// value: the depenent operators required by the operator
3535
var operatorDependencies = map[string][]string{
@@ -106,7 +106,7 @@ func (tm *TestManager) GenerateReport(opt *Options) error {
106106
}
107107
fmt.Println(string(out))
108108
if opt.JUnitDir != "" {
109-
filePrefix := "cluster-health-check"
109+
filePrefix := "junit_e2e_analysis"
110110
start := time.Now()
111111
timeSuffix := fmt.Sprintf("_%s", start.UTC().Format("20060102-150405"))
112112
path := filepath.Join(opt.JUnitDir, fmt.Sprintf("%s_%s.xml", filePrefix, timeSuffix))
@@ -121,7 +121,7 @@ func (opt *Options) Run() error {
121121
tm := NewTestManager()
122122
defer tm.GenerateReport(opt)
123123

124-
tcName := "Verify the cluster can be connected"
124+
tcName := "verify the cluster can be connected"
125125
tc := NewTestCase(tcName)
126126
cfg, err := e2e.LoadConfig()
127127
if err != nil {
@@ -152,7 +152,11 @@ func (opt *Options) Run() error {
152152
return nil
153153
}
154154
if err != nil {
155+
failureMsg := fmt.Sprintf("cluster version stability check failed: %v", err)
156+
tm.AddTestCase(tc, failureMsg, "")
155157
logrus.Warnf("Continue though cluster version stability check failed (%v)", err)
158+
} else {
159+
tm.AddTestCase(tc, "", "")
156160
}
157161

158162
// ======================================================
@@ -273,6 +277,9 @@ func (opt *Options) Run() error {
273277
failureMsg = fmt.Sprintf("Operator %q - Available=%s, Degraded=%s, Progressing=%s", opName, available, degraded, progressing)
274278
logrus.Infof("%s", failureMsg)
275279
tm.AddTestCase(tc, failureMsg, "")
280+
// add a flake case in here to begin with, so that we can analyze new tests without causing job failures.
281+
// once we verify stability we can remove the flake
282+
tm.AddTestCase(tc, "", "")
276283
failedOperators[opName] = true
277284
}
278285
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package health_check
1+
package e2e_analysis
22

33
import (
44
"testing"

0 commit comments

Comments
 (0)