Skip to content

Commit 79c3be0

Browse files
Merge pull request #30211 from jianlinliu/TRT-2275
TRT-2275: introduce cluster e2e-analysis sub command for openshift-tests
2 parents 8c47e1d + 31682ef commit 79c3be0

File tree

4 files changed

+861
-0
lines changed

4 files changed

+861
-0
lines changed

cmd/openshift-tests/openshift-tests.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +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+
e2e_analysis "github.com/openshift/origin/pkg/cmd/openshift-tests/e2e-analysis"
2526
"github.com/openshift/origin/pkg/cmd/openshift-tests/images"
2627
"github.com/openshift/origin/pkg/cmd/openshift-tests/list"
2728
"github.com/openshift/origin/pkg/cmd/openshift-tests/monitor"
@@ -100,6 +101,7 @@ func main() {
100101
monitor.NewMonitorCommand(ioStreams),
101102
disruption.NewDisruptionCommand(ioStreams),
102103
risk_analysis.NewTestFailureRiskAnalysisCommand(),
104+
e2e_analysis.NewTestFailureClusterAnalysisCheckCommand(),
103105
run_resource_watch.NewRunResourceWatchCommand(),
104106
timeline.NewTimelineCommand(ioStreams),
105107
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+
}

0 commit comments

Comments
 (0)