forked from openshift/openshift-azure
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openshift#1991 from mjudeikis/test.command.generator
auto-generated docs
- Loading branch information
Showing
7 changed files
with
125 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Test Commands | ||
|
||
``` | ||
/test codecov | ||
/test e2e-applysecurityupdates | ||
/test conformance | ||
/test e2e-changeloglevel | ||
/test e2e-create-20190430 | ||
/test e2e-create-20190930 | ||
/test e2e-create-20191027 | ||
/test e2e-etcdbackuprecovery | ||
/test e2e-forceupdate | ||
/test e2e-keyrotation | ||
/test e2e-reimagevm | ||
/test e2e-scaleupdown | ||
/test unit | ||
/test upgrade-v10.0 | ||
/test upgrade-v7.1 | ||
/test upgrade-v9.0 | ||
/test vmimage | ||
/test images | ||
/test verify | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package main | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
// This file exists because this package has no unit tests. Codecov does not | ||
// report packages with no unit tests as 0% coverage, incorrectly inflating our | ||
// coverage statistics. When unit tests are added to this package, this file | ||
// can be removed. | ||
|
||
func TestDummyCodeCov(t *testing.T) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Test Commands | ||
|
||
``` | ||
{{ range $value := . }} | ||
{{ $value }} | ||
{{ end }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"io/ioutil" | ||
"net/http" | ||
"os" | ||
"text/template" | ||
|
||
"github.com/ghodss/yaml" | ||
) | ||
|
||
type prow struct { | ||
Presubmits struct { | ||
OpenshiftOpenshiftAzure []struct { | ||
RerunCommand string `json:"rerun_command"` | ||
} `json:"openshift/openshift-azure"` | ||
} `json:"presubmits"` | ||
} | ||
|
||
func get(url string) ([]byte, error) { | ||
/* #nosec - this helper is supposed to take an arbitrary url */ | ||
resp, err := http.Get(url) | ||
if err != nil { | ||
return nil, err | ||
} | ||
defer resp.Body.Close() | ||
|
||
if resp.StatusCode != http.StatusOK { | ||
return nil, fmt.Errorf("unexpected status code %d", resp.StatusCode) | ||
} | ||
|
||
return ioutil.ReadAll(resp.Body) | ||
} | ||
|
||
func run() error { | ||
b, err := get("https://raw.githubusercontent.com/openshift/release/master/ci-operator/jobs/openshift/openshift-azure/openshift-openshift-azure-master-presubmits.yaml") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
var prow prow | ||
err = yaml.Unmarshal(b, &prow) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
var commands []string | ||
for _, c := range prow.Presubmits.OpenshiftOpenshiftAzure { | ||
commands = append(commands, c.RerunCommand) | ||
} | ||
|
||
return template.Must(template.New("commands.md").ParseFiles("hack/generate-test-commands/commands.md")).Execute(os.Stdout, commands) | ||
} | ||
|
||
func main() { | ||
if err := run(); err != nil { | ||
panic(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters