Skip to content

Commit

Permalink
test: remove system tests skip flag support (#6567)
Browse files Browse the repository at this point in the history
The Go test supports this capability now
  • Loading branch information
nopcoder authored Sep 9, 2023
1 parent 14bb533 commit b665bcb
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 35 deletions.
1 change: 0 additions & 1 deletion esti/gc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ func newSubmitConfig(repo string, blockstoreType string, doMark bool, doSweep bo
}

func TestCommittedGC(t *testing.T) {
SkipTestIfAskedTo(t)
blockstoreType := viper.GetString(config.BlockstoreTypeKey)
logger.Infof("Got blockstore type %s", blockstoreType)
ctx := context.Background()
Expand Down
1 change: 0 additions & 1 deletion esti/lakectl_doctor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
)

func TestLakectlDoctor(t *testing.T) {
SkipTestIfAskedTo(t)
accessKeyID := viper.GetString("access_key_id")
secretAccessKey := viper.GetString("secret_access_key")
endPointURL := viper.GetString("endpoint_url") + "/api/v1"
Expand Down
14 changes: 0 additions & 14 deletions esti/lakectl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ import (
var emptyVars = make(map[string]string)

func TestLakectlHelp(t *testing.T) {
SkipTestIfAskedTo(t)
RunCmdAndVerifySuccessWithFile(t, Lakectl(), false, "lakectl_help", emptyVars)
RunCmdAndVerifySuccessWithFile(t, Lakectl()+" --help", false, "lakectl_help", emptyVars)
RunCmdAndVerifySuccessWithFile(t, Lakectl(), true, "lakectl_help", emptyVars)
RunCmdAndVerifySuccessWithFile(t, Lakectl()+" --help", true, "lakectl_help", emptyVars)
}

func TestLakectlBasicRepoActions(t *testing.T) {
SkipTestIfAskedTo(t)
// RunCmdAndVerifySuccess(t, Lakectl()+" repo list", false, "\n", emptyVars)

// Fails due to the usage of repos for isolation - esti creates repos in parallel and
Expand Down Expand Up @@ -99,7 +97,6 @@ func TestLakectlBasicRepoActions(t *testing.T) {
}

func TestLakectlCommit(t *testing.T) {
SkipTestIfAskedTo(t)
repoName := generateUniqueRepositoryName()
storage := generateUniqueStorageNamespace(repoName)
vars := map[string]string{
Expand Down Expand Up @@ -153,7 +150,6 @@ func TestLakectlCommit(t *testing.T) {
}

func TestLakectlBranchAndTagValidation(t *testing.T) {
SkipTestIfAskedTo(t)
repoName := generateUniqueRepositoryName()
storage := generateUniqueStorageNamespace(repoName)
validTagName := "my.valid.tag"
Expand Down Expand Up @@ -186,7 +182,6 @@ func TestLakectlBranchAndTagValidation(t *testing.T) {
}

func TestLakectlMergeAndStrategies(t *testing.T) {
SkipTestIfAskedTo(t)
repoName := generateUniqueRepositoryName()
storage := generateUniqueStorageNamespace(repoName)
vars := map[string]string{
Expand Down Expand Up @@ -274,7 +269,6 @@ func TestLakectlMergeAndStrategies(t *testing.T) {
}

func TestLakectlAnnotate(t *testing.T) {
SkipTestIfAskedTo(t)
repoName := generateUniqueRepositoryName()
storage := generateUniqueStorageNamespace(repoName)
vars := map[string]string{
Expand Down Expand Up @@ -343,7 +337,6 @@ func TestLakectlAnnotate(t *testing.T) {
}

func TestLakectlAuthUsers(t *testing.T) {
SkipTestIfAskedTo(t)
userName := "test_user"
vars := map[string]string{
"ID": userName,
Expand All @@ -361,7 +354,6 @@ func TestLakectlAuthUsers(t *testing.T) {
}

func TestLakectlIngestS3(t *testing.T) {
SkipTestIfAskedTo(t)
// Specific S3 test - due to the limitation on ingest source type that has to match lakefs underlying block store,
// this test can only run on AWS setup, and therefore is skipped for other store types
skipOnSchemaMismatch(t, IngestTestBucketPath)
Expand Down Expand Up @@ -397,7 +389,6 @@ func TestLakectlIngestS3(t *testing.T) {
}

func TestLakectlFsDownload(t *testing.T) {
SkipTestIfAskedTo(t)
repoName := generateUniqueRepositoryName()
storage := generateUniqueStorageNamespace(repoName)
vars := map[string]string{
Expand Down Expand Up @@ -460,7 +451,6 @@ func TestLakectlFsDownload(t *testing.T) {
}

func TestLakectlFsStat(t *testing.T) {
SkipTestIfAskedTo(t)
repoName := generateUniqueRepositoryName()
storage := generateUniqueStorageNamespace(repoName)
vars := map[string]string{
Expand Down Expand Up @@ -513,8 +503,6 @@ func TestLakectlFsStat(t *testing.T) {
}

func TestLakectlImport(t *testing.T) {
SkipTestIfAskedTo(t)

// TODO(barak): generalize test to work all supported object stores
skipOnSchemaMismatch(t, IngestTestBucketPath)

Expand All @@ -535,7 +523,6 @@ func TestLakectlImport(t *testing.T) {
}

func TestLakectlCherryPick(t *testing.T) {
SkipTestIfAskedTo(t)
repoName := generateUniqueRepositoryName()
storage := generateUniqueStorageNamespace(repoName)
vars := map[string]string{
Expand Down Expand Up @@ -606,7 +593,6 @@ func TestLakectlCherryPick(t *testing.T) {
}

func TestLakectlBisect(t *testing.T) {
SkipTestIfAskedTo(t)
repoName := generateUniqueRepositoryName()
storage := generateUniqueStorageNamespace(repoName)
vars := map[string]string{
Expand Down
14 changes: 0 additions & 14 deletions esti/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"net/http"
"os"
"regexp"
"strconv"
"strings"
"testing"
Expand Down Expand Up @@ -46,8 +45,6 @@ var (
groupsToKeep arrayFlags
usersToKeep arrayFlags
policiesToKeep arrayFlags

testsToSkipRegex *regexp.Regexp
)

var (
Expand Down Expand Up @@ -257,7 +254,6 @@ func TestMain(m *testing.M) {
adminAccessKeyID := flag.String("admin-access-key-id", DefaultAdminAccessKeyID, "lakeFS Admin access key ID")
adminSecretAccessKey := flag.String("admin-secret-access-key", DefaultAdminSecretAccessKey, "lakeFS Admin secret access key")
cleanupEnv := flag.Bool("cleanup-env-pre-run", false, "Clean repositories, groups, users and polices before running esti tests")
testsToSkip := flag.String("skip", "", "Tests to skip in a regex format")
flag.Var(&repositoriesToKeep, "repository-to-keep", "Repositories to keep in case of pre-run cleanup")
flag.Var(&groupsToKeep, "group-to-keep", "Groups to keep in case of pre-run cleanup")
flag.Var(&usersToKeep, "user-to-keep", "Users to keep in case of pre-run cleanup")
Expand Down Expand Up @@ -290,10 +286,6 @@ func TestMain(m *testing.M) {
azureStorageAccount = viper.GetString("azure_storage_account")
azureStorageAccessKey = viper.GetString("azure_storage_access_key")

if *testsToSkip != "" {
testsToSkipRegex = regexp.MustCompile(*testsToSkip)
}

setupLakeFS := viper.GetBool("setup_lakefs")
if !setupLakeFS && *cleanupEnv {
logger.
Expand All @@ -319,9 +311,3 @@ func TestMain(m *testing.M) {
logger.Info("Setup succeeded, running the tests")
os.Exit(m.Run())
}

func SkipTestIfAskedTo(t testing.TB) {
if testsToSkipRegex != nil && testsToSkipRegex.MatchString(t.Name()) {
t.SkipNow()
}
}
1 change: 0 additions & 1 deletion esti/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
)

func TestRepositoryBasicOps(t *testing.T) {
SkipTestIfAskedTo(t)
ctx := context.Background()
const numOfRepos = 5

Expand Down
1 change: 0 additions & 1 deletion esti/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
const IngestTestBucketPath = "s3://esti-system-testing-data/ingest-test-data/"

func TestS3Walk(t *testing.T) {
SkipTestIfAskedTo(t)
// Specific S3 test, this test can only run on AWS setup, and therefore is skipped for other store types
skipOnSchemaMismatch(t, IngestTestBucketPath)

Expand Down
1 change: 0 additions & 1 deletion esti/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func makeRepositoryName(name string) string {
}

func setupTest(t testing.TB) (context.Context, logging.Logger, string) {
SkipTestIfAskedTo(t)
ctx := context.Background()
name := makeRepositoryName(t.Name())
logger := logger.WithField("testName", name)
Expand Down
1 change: 0 additions & 1 deletion esti/ugc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ type UncommittedFindings struct {
}

func TestUncommittedGC(t *testing.T) {
SkipTestIfAskedTo(t)
requireBlockstoreType(t, block.BlockstoreTypeS3)
ctx := context.Background()
prepareForUncommittedGC(t, ctx)
Expand Down
1 change: 0 additions & 1 deletion esti/unified_gc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func gcTestCommit(t *testing.T, ctx context.Context, branch string, daysAgo int)
}

func TestUnifiedGC(t *testing.T) {
SkipTestIfAskedTo(t)
ctx := context.Background()
prepareForUnifiedGC(t, ctx)
committedCreateEvents := []objectEvent{
Expand Down

0 comments on commit b665bcb

Please sign in to comment.