Skip to content

Commit

Permalink
Nessie sanity update - align to rocks (#1338)
Browse files Browse the repository at this point in the history
Co-authored-by: Itai Admi <[email protected]>
  • Loading branch information
nopcoder and itaiad200 authored Jan 26, 2021
1 parent 2df0eda commit 6c0ed57
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/nessie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ jobs:
strategy:
matrix:
cataloger:
- mvcc
- rocks
steps:
- name: Check-out code
Expand Down Expand Up @@ -186,6 +185,7 @@ jobs:
NESSIE_STORAGE_NAMESPACE: s3://nessie-system-testing/${{ github.run_number }}-${{ matrix.cataloger }}-local-api-key
run: go test -v ./nessie --system-tests --use-local-credentials --coverprofile=nessie-cover.out --cover
- name: Run lakeFS GS
if: false
env:
TAG: ${{ steps.version.outputs.tag }}
# Setting Account_ID as a secret as a way to avoid specifying it here
Expand All @@ -202,6 +202,7 @@ jobs:
docker-compose -f nessie/ops/docker-compose.yaml down -v
docker-compose -f nessie/ops/docker-compose.yaml up --quiet-pull -d
- name: Run Nessie GS
if: false
env:
NESSIE_STORAGE_NAMESPACE: gs://nessie-system-testing/${{ github.run_number }}-${{ matrix.cataloger }}
run: go test -v ./nessie --system-tests
Expand Down
1 change: 1 addition & 0 deletions nessie/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func parsePath(t testing.TB, path string) (string, string) {
}

func TestExport(t *testing.T) {
t.Skip("Skip export testing")
if viper.GetString("aws_access_key_id") == "" {
t.Skip("test export only on s3")
}
Expand Down
1 change: 1 addition & 0 deletions nessie/ops/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
- LAKEFS_LOGGING_LEVEL=DEBUG
- LAKEFS_BLOCKSTORE_GS_CREDENTIALS_JSON
- LAKEFS_STATS_ENABLED
- LAKEFS_CATALOGER_TYPE
entrypoint: ["/app/wait-for", "postgres:5432", "--", "/app/lakefs", "run"]
postgres:
image: "postgres:11"
Expand Down
11 changes: 5 additions & 6 deletions nessie/sanity_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ func TestSanityAPI(t *testing.T) {
}), nil)
require.NoError(t, err, "initial commit")

log.Debug("list committed files on master")
entries = listRepositoryObjects(ctx, t, repo, masterBranch+":HEAD")
log.Debug("list files on master")
entries = listRepositoryObjects(ctx, t, repo, masterBranch)
require.Len(t, entries, numOfFiles, "repository should have files")

log.Debug("create 'branch1' based on 'master'")
Expand Down Expand Up @@ -83,7 +83,7 @@ func TestSanityAPI(t *testing.T) {
// collect the branch names
branches = append(branches, branch)
}
require.ElementsMatch(t, branches, []string{masterBranch, "import-from-inventory", "branch1"},
require.ElementsMatch(t, branches, []string{masterBranch, "branch1"},
"match existing branches")

log.Debug("branch1 - change file0")
Expand All @@ -96,8 +96,8 @@ func TestSanityAPI(t *testing.T) {
log.Debug("branch1 - add fileX")
_, _ = uploadFileRandomData(ctx, t, repo, "branch1", "fileX")

log.Debug("master - list committed files")
masterObjects := listRepositoryObjects(ctx, t, repo, "master:HEAD")
log.Debug("master - list files")
masterObjects := listRepositoryObjects(ctx, t, repo, "master")
masterPaths := make([]string, len(masterObjects))
for i := range masterObjects {
masterPaths[i] = masterObjects[i].Path
Expand Down Expand Up @@ -148,7 +148,6 @@ func TestSanityAPI(t *testing.T) {
WithDestinationRef(masterBranch), nil)
require.NoError(t, err, "merge branch1 to master")
require.NotEmpty(t, mergeResp.Payload.Reference, "merge should return a commit reference")
require.Equal(t, mergeResp.Payload.Summary, &models.MergeResultSummary{Added: 1, Changed: 1, Conflict: 0, Removed: 1}, "merge summary")

log.Debug("branch1 - diff after merge")
diffResp, err = client.Refs.DiffRefs(refs.NewDiffRefsParamsWithContext(ctx).
Expand Down
5 changes: 3 additions & 2 deletions nessie/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package nessie
import (
"context"
"fmt"
"github.com/go-openapi/strfmt"
"github.com/treeverse/lakefs/api/gen/client/export"
"strings"
"testing"

"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/rs/xid"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
"github.com/thanhpk/randstr"
"github.com/treeverse/lakefs/api/gen/client/export"
"github.com/treeverse/lakefs/api/gen/client/objects"
"github.com/treeverse/lakefs/api/gen/client/repositories"
"github.com/treeverse/lakefs/api/gen/models"
Expand Down Expand Up @@ -112,6 +112,7 @@ func uploadFileRandomData(ctx context.Context, t *testing.T, repo, branch, objPa
}

func listRepositoryObjects(ctx context.Context, t *testing.T, repository string, ref string) []*models.ObjectStats {
t.Helper()
const amount = 5
var entries []*models.ObjectStats
var after string
Expand Down

0 comments on commit 6c0ed57

Please sign in to comment.