Skip to content

Commit

Permalink
Merge pull request #131240 from DarrylWong/backport24.1-130963
Browse files Browse the repository at this point in the history
release-24.1: roachtest, teamcity: publish runner logs to same directory
  • Loading branch information
DarrylWong authored Sep 24, 2024
2 parents 82a78fd + 969700d commit 6aaa174
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions pkg/cmd/roachtest/roachtestflags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,14 @@ var (
providers. Set this to false when running many concurrent Azure tests. Azure
can return stale VM information when many PUT calls are made in succession.`,
})

AlwaysCollectArtifacts bool = false
_ = registerRunFlag(&AlwaysCollectArtifacts, FlagInfo{
Name: "always-collect-artifacts",
Usage: `
Always collect artifacts during test teardown, even if the test did not
time out or fail.`,
})
)

// The flags below override the final cluster configuration. They have no
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func runTests(register func(registry.Registry), filter *registry.TestFilter) err

if roachtestflags.TeamCity {
// Collect the runner logs.
fmt.Printf("##teamcity[publishArtifacts '%s']\n", filepath.Join(literalArtifactsDir, runnerLogsDir))
fmt.Printf("##teamcity[publishArtifacts '%s' => '%s']\n", filepath.Join(literalArtifactsDir, runnerLogsDir), runnerLogsDir)
}

if summaryErr := maybeDumpSummaryMarkdown(runner); summaryErr != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/test_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ func (r *testRunner) postTestAssertions(
func (r *testRunner) teardownTest(
ctx context.Context, t *testImpl, c *clusterImpl, timedOut bool,
) error {
if timedOut || t.Failed() {
if timedOut || t.Failed() || roachtestflags.AlwaysCollectArtifacts {
err := r.collectArtifacts(ctx, t, c, timedOut, time.Hour)
if err != nil {
t.L().Printf("error collecting artifacts: %v", err)
Expand Down

0 comments on commit 6aaa174

Please sign in to comment.