Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
54 changes: 54 additions & 0 deletions cmd/openshift-tests/command.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package main

import (
"context"
"fmt"

"github.com/openshift/origin/pkg/clioptions/imagesetup"
"github.com/openshift/origin/pkg/cmd/openshift-tests/run"
"github.com/openshift/origin/pkg/testsuites"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/kubectl/pkg/util/templates"
)

func NewRunCommand(streams genericclioptions.IOStreams) *cobra.Command {
f := run.NewRunSuiteFlags(streams, imagesetup.DefaultTestImageMirrorLocation, StandardTestSuites())

cmd := &cobra.Command{
Use: "run SUITE",
Short: "Run a test suite",
Long: templates.LongDesc(`
Run a test suite against an OpenShift server

This command will run one of the following suites against a cluster identified by the current
KUBECONFIG file. See the suite description for more on what actions the suite will take.

If you specify the --dry-run argument, the names of each individual test that is part of the
suite will be printed, one per line. You may filter this list and pass it back to the run
command with the --file argument. You may also pipe a list of test names, one per line, on
standard input by passing "-f -".

`) + testsuites.SuitesString(StandardTestSuites(), "\n\nAvailable test suites:\n\n"),

SilenceUsage: true,
SilenceErrors: true,
RunE: func(cmd *cobra.Command, args []string) error {
o, err := f.ToOptions(args)
if err != nil {
fmt.Fprintf(f.IOStreams.ErrOut, "error converting to options: %v", err)
return err
}

ctx, cancel := context.WithCancel(context.Background())
defer cancel()
if err := o.Run(ctx); err != nil {
fmt.Fprintf(f.IOStreams.ErrOut, "error running options: %v", err)
return err
}
return nil
},
}
f.BindFlags(cmd.Flags())
return cmd
}
251 changes: 0 additions & 251 deletions cmd/openshift-tests/dev.go

This file was deleted.

Loading