Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-15.0' into backport-1409…
Browse files Browse the repository at this point in the history
…3-to-release-15.0

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
  • Loading branch information
frouioui committed Sep 28, 2023
2 parents 84c66f2 + cdefdd8 commit f669f4b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/static_checks_etc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ jobs:
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: actions/checkout@v3

- name: Run FOSSA scan and upload build data
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: fossa-contrib/fossa-action@v1
with:
fossa-api-key: 76d7483ea206d530d9452e44bffe7ba8

- name: Check for changes in Go files
if: steps.skip-workflow.outputs.skip-workflow == 'false'
uses: frouioui/paths-filter@main
Expand Down
18 changes: 17 additions & 1 deletion go/test/endtoend/reparent/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,25 @@ func SetupRangeBasedCluster(ctx context.Context, t *testing.T) *cluster.LocalPro
return setupCluster(ctx, t, ShardName, []string{cell1}, []int{2}, "semi_sync")
}

// TeardownCluster is used to teardown the reparent cluster
// TeardownCluster is used to teardown the reparent cluster. When
// run in a CI environment -- which is considered true when the
// "CI" env variable is set to "true" -- the teardown also removes
// the VTDATAROOT directory that was used for the test/cluster.
func TeardownCluster(clusterInstance *cluster.LocalProcessCluster) {
usedRoot := clusterInstance.CurrentVTDATAROOT
clusterInstance.Teardown()
// This is always set to "true" on GitHub Actions runners:
// https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
ci, ok := os.LookupEnv("CI")
if !ok || strings.ToLower(ci) != "true" {
// Leave the directory in place to support local debugging.
return
}
// We're running in the CI, so free up disk space for any
// subsequent tests.
if err := os.RemoveAll(usedRoot); err != nil {
log.Errorf("Failed to remove previously used VTDATAROOT (%s): %v", usedRoot, err)
}
}

func setupCluster(ctx context.Context, t *testing.T, shardName string, cells []string, numTablets []int, durability string) *cluster.LocalProcessCluster {
Expand Down

0 comments on commit f669f4b

Please sign in to comment.