-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(backup_test): add missing 'Integration' suffix to tests (#4176)
* fix(backup_test): add missing 'Integration' suffix to tests Some tests were missing the Integration suffix in their names. This resulted in not including them in the 'make pkg-integration-test' command used when running tests on gh actions. * refactor(testutils): export CheckAnyConstraint It is also useful for backup svc tests. * fix(backup_test): skip TestBackupSkipSchemaIntegration for older Scylla versions
- Loading branch information
1 parent
a16e511
commit 6860554
Showing
6 changed files
with
50 additions
and
32 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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2024 ScyllaDB | ||
|
||
package testutils | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/scylladb/scylla-manager/v3/pkg/scyllaclient" | ||
"github.com/scylladb/scylla-manager/v3/pkg/util/version" | ||
) | ||
|
||
// CheckAnyConstraint checks if any of the passed version constraints are satisfied. | ||
// Can be used for skipping tests which make sense only for certain Scylla versions. | ||
func CheckAnyConstraint(t *testing.T, client *scyllaclient.Client, constraints ...string) bool { | ||
t.Helper() | ||
|
||
ni, err := client.AnyNodeInfo(context.Background()) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
for _, c := range constraints { | ||
ok, err := version.CheckConstraint(ni.ScyllaVersion, c) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
if ok { | ||
return true | ||
} | ||
} | ||
return false | ||
} |