Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow junit output filename to be overridden #6211

Merged
merged 1 commit into from Dec 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions test/extended/networking.sh
Expand Up @@ -101,6 +101,7 @@ function test-osdn-plugin() {
save-artifacts "${name}" "${OPENSHIFT_CONFIG_ROOT}"

os::log::info "Running networking e2e tests against the ${name} plugin"
export TEST_REPORT_FILE_NAME="${name}-junit"
local log_dir="${LOG_DIR}/${name}"
mkdir -p "${log_dir}"

Expand Down
10 changes: 9 additions & 1 deletion test/extended/util/test.go
Expand Up @@ -26,10 +26,13 @@ import (

var reportDir string

var reportFileName string

// init initialize the extended testing suite.
// You can set these environment variables to configure extended tests:
// KUBECONFIG - Path to kubeconfig containing embedded authinfo
// TEST_REPORT_DIR - If set, JUnit output will be written to this directory for each test
// TEST_REPORT_FILE_NAME - If set, will determine the name of the file that JUnit output is written to
func InitTest() {
extendedOutputDir := filepath.Join(os.TempDir(), "openshift-extended-tests")
os.MkdirAll(extendedOutputDir, 0777)
Expand All @@ -42,6 +45,11 @@ func InitTest() {

reportDir = os.Getenv("TEST_REPORT_DIR")

reportFileName = os.Getenv("TEST_REPORT_FILE_NAME")
if reportFileName == "" {
reportFileName = "junit"
}

//flag.StringVar(&TestContext.KubeConfig, clientcmd.RecommendedConfigPathFlag, KubeConfigPath(), "Path to kubeconfig containing embedded authinfo.")
flag.StringVar(&TestContext.OutputDir, "extended-tests-output-dir", extendedOutputDir, "Output directory for interesting/useful test data, like performance data, benchmarks, and other metrics.")
rflag.StringVar(&config.GinkgoConfig.FocusString, "focus", "", "DEPRECATED: use --ginkgo.focus")
Expand Down Expand Up @@ -70,7 +78,7 @@ func ExecuteTest(t *testing.T, suite string) {
gomega.RegisterFailHandler(ginkgo.Fail)

if reportDir != "" {
r = append(r, reporters.NewJUnitReporter(path.Join(reportDir, fmt.Sprintf("junit_%02d.xml", config.GinkgoConfig.ParallelNode))))
r = append(r, reporters.NewJUnitReporter(path.Join(reportDir, fmt.Sprintf("%s_%02d.xml", reportFileName, config.GinkgoConfig.ParallelNode))))
}

r = append(r, NewSimpleReporter())
Expand Down