-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bazci,ci,dev: update how
stress
is invoked
We give both `bazci` and `dev` a subcommand to merge `test.xml` files, and update `dev` and the various `stress` invocations in CI accordingly to make use of the `-shardable-artifacts` feature. Closes #74325. Release note: None
- Loading branch information
1 parent
28c24d6
commit fff8684
Showing
10 changed files
with
109 additions
and
16 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
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ go_library( | |
"lint.go", | ||
"logic.go", | ||
"main.go", | ||
"merge_test_xmls.go", | ||
"test.go", | ||
"util.go", | ||
], | ||
|
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,49 @@ | ||
// Copyright 2022 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package main | ||
|
||
import ( | ||
"encoding/xml" | ||
"io/ioutil" | ||
"os" | ||
|
||
bazelutil "github.com/cockroachdb/cockroach/pkg/build/util" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func makeMergeTestXMLsCmd(runE func(cmd *cobra.Command, args []string) error) *cobra.Command { | ||
mergeTestXMLsCommand := &cobra.Command{ | ||
Use: "merge-test-xmls XML1 [XML2...]", | ||
Short: "Merge the given test XML's (utility command)", | ||
Long: "Merge the given test XML's (utility command)", | ||
Args: cobra.MinimumNArgs(1), | ||
RunE: runE, | ||
} | ||
mergeTestXMLsCommand.Hidden = true | ||
return mergeTestXMLsCommand | ||
} | ||
|
||
func (d *dev) mergeTestXMLs(cmd *cobra.Command, xmls []string) error { | ||
var suites []bazelutil.TestSuites | ||
for _, file := range xmls { | ||
suitesToAdd := bazelutil.TestSuites{} | ||
input, err := ioutil.ReadFile(file) | ||
if err != nil { | ||
return err | ||
} | ||
err = xml.Unmarshal(input, &suitesToAdd) | ||
if err != nil { | ||
return err | ||
} | ||
suites = append(suites, suitesToAdd) | ||
} | ||
return bazelutil.MergeTestXMLs(suites, os.Stdout) | ||
} |
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
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
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