Skip to content

Commit

Permalink
testsuite: use current uplink for tests
Browse files Browse the repository at this point in the history
For a moment we stopped using current uplink with testsuite to be
able to do refactoring which involved storj/storj and storj/uplink.
Now we can bring back link to current uplink code in testsuite.

As an addition testsuite dependencies were updated and that requires
change in test to reflect "metainfo.multiple-versions" flag enabled
by default now for satellites.

Change-Id: I7dbc08a4c85ce9684969abc33786ce10dd4b557e
  • Loading branch information
mniewrzal authored and Storj Robot committed Dec 1, 2022
1 parent b861666 commit 97ec26d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
11 changes: 5 additions & 6 deletions testsuite/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ module storj.io/uplink/testsuite

go 1.17

// TODO enable after adjusting storj/storj
// replace storj.io/uplink => ../
replace storj.io/uplink => ../

require (
github.com/stretchr/testify v1.7.0
github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3
github.com/zeebo/errs v1.3.0
go.uber.org/zap v1.16.0
storj.io/common v0.0.0-20221024150824-a2a5c611dacf
storj.io/common v0.0.0-20221123115229-fed3e6651b63
storj.io/drpc v0.0.32
storj.io/storj v0.12.1-0.20221107134831-e4fab975ad9c
storj.io/uplink v1.9.1-0.20221103133433-65947dace243
storj.io/storj v0.12.1-0.20221129225603-3fe6aee78624
storj.io/uplink v1.9.1-0.20221123134449-bf3a9813b6e0
)

require (
Expand Down Expand Up @@ -98,5 +97,5 @@ require (
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
storj.io/monkit-jaeger v0.0.0-20220915074555-d100d7589f41 // indirect
storj.io/private v0.0.0-20221011183246-586e5f48357a // indirect
storj.io/private v0.0.0-20221108123115-3a27297f0b78 // indirect
)
15 changes: 6 additions & 9 deletions testsuite/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -921,16 +921,13 @@ sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
storj.io/common v0.0.0-20220719163320-cd2ef8e1b9b0/go.mod h1:mCYV6Ud5+cdbuaxdPD5Zht/HYaIn0sffnnws9ErkrMQ=
storj.io/common v0.0.0-20220915180246-7826900e2b06/go.mod h1:+gF7jbVvpjVIVHhK+EJFhfPbudX395lnPq/dKkj/Qys=
storj.io/common v0.0.0-20221018143517-9eb8213fe465/go.mod h1:+gF7jbVvpjVIVHhK+EJFhfPbudX395lnPq/dKkj/Qys=
storj.io/common v0.0.0-20221024150824-a2a5c611dacf h1:nHQpBDiyH62mO5W/tGBRYxLIWuTA6q14pSvx3BehU8Q=
storj.io/common v0.0.0-20221024150824-a2a5c611dacf/go.mod h1:+gF7jbVvpjVIVHhK+EJFhfPbudX395lnPq/dKkj/Qys=
storj.io/common v0.0.0-20221123115229-fed3e6651b63 h1:OuleF/3FvZe3Nnu6NdwVr+FvCXjfD4iNNdgfI2kcs3k=
storj.io/common v0.0.0-20221123115229-fed3e6651b63/go.mod h1:+gF7jbVvpjVIVHhK+EJFhfPbudX395lnPq/dKkj/Qys=
storj.io/drpc v0.0.32 h1:5p5ZwsK/VOgapaCu+oxaPVwO6UwIs+iwdMiD50+R4PI=
storj.io/drpc v0.0.32/go.mod h1:6rcOyR/QQkSTX/9L5ZGtlZaE2PtXTTZl8d+ulSeeYEg=
storj.io/monkit-jaeger v0.0.0-20220915074555-d100d7589f41 h1:SVuEocEhZfFc13J1AmlVLitdGXTVrvmbzN4Z9C9Ms40=
storj.io/monkit-jaeger v0.0.0-20220915074555-d100d7589f41/go.mod h1:iK+dmHZZXQlW7ahKdNSOo+raMk5BDL2wbD62FIeXLWs=
storj.io/private v0.0.0-20221011183246-586e5f48357a h1:zF1LgUhKQZgbdrnm86dclK6fl4ROkZdT9BupbiQYKKs=
storj.io/private v0.0.0-20221011183246-586e5f48357a/go.mod h1:hc63X333SVJ3UrOxXpGN4VnwqnmbWgAHln3wYJ8AroI=
storj.io/storj v0.12.1-0.20221107134831-e4fab975ad9c h1:MQ2EaMU4co1ls4CucUsnFGC6c7kprpBtb8VmaLe2U4A=
storj.io/storj v0.12.1-0.20221107134831-e4fab975ad9c/go.mod h1:o/BXceHBKo18+PXZPGB0eSyOeG1lzVt4HIzvj2ugxqA=
storj.io/uplink v1.9.1-0.20221103133433-65947dace243 h1:WbUKIKMNnvBzRv5A6FL1x3Sz9jlafJOH7zSkMccjl7M=
storj.io/uplink v1.9.1-0.20221103133433-65947dace243/go.mod h1:GFXg/hWi64mk1BG/oE8rPIlzk5iwbEg+TVyb37DxUtA=
storj.io/private v0.0.0-20221108123115-3a27297f0b78 h1:kHJEx5AAASp+zGaBPwBJyqZ5zFkde6nLyELGlxdZmiM=
storj.io/private v0.0.0-20221108123115-3a27297f0b78/go.mod h1:hc63X333SVJ3UrOxXpGN4VnwqnmbWgAHln3wYJ8AroI=
storj.io/storj v0.12.1-0.20221129225603-3fe6aee78624 h1:t4EpIXdUg6vbaTdS361sHEaHv9tf63Xl4uWyS+0RkA8=
storj.io/storj v0.12.1-0.20221129225603-3fe6aee78624/go.mod h1:eN6alWciJuCd6R5+v1LbCVDMz1zjE9kCkys9AowU4P4=
19 changes: 14 additions & 5 deletions testsuite/object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ func TestConcurrentUploadAndCommit(t *testing.T) {
require.NoError(t, err)
assertObjectEmptyCreated(t, upload1.Info(), "test.dat")

randData := testrand.Bytes(30 * memory.KiB)
_, err = upload1.Write(randData)
randDataA := testrand.Bytes(10 * memory.KiB)
_, err = upload1.Write(randDataA)
require.NoError(t, err)
assertObjectEmptyCreated(t, upload1.Info(), "test.dat")

Expand All @@ -441,15 +441,24 @@ func TestConcurrentUploadAndCommit(t *testing.T) {
require.NoError(t, err)
assertObjectEmptyCreated(t, upload2.Info(), "test.dat")

_, err = upload2.Write(randData)
randDataB := testrand.Bytes(10 * memory.KiB)
_, err = upload2.Write(randDataB)
require.NoError(t, err)

err = upload2.Commit()
require.NoError(t, err)

// Try to commit the first object, but this will fail because it was deleted.
data, err := planet.Uplinks[0].Download(ctx, planet.Satellites[0], "testbucket", "test.dat")
require.NoError(t, err)
require.Equal(t, randDataB, data)

// first pending object is still available so it will replace existing object
err = upload1.Commit()
require.Error(t, err)
require.NoError(t, err)

data, err = planet.Uplinks[0].Download(ctx, planet.Satellites[0], "testbucket", "test.dat")
require.NoError(t, err)
require.Equal(t, randDataA, data)

_, err = project.StatObject(ctx, "testbucket", "test.dat")
require.NoError(t, err)
Expand Down

0 comments on commit 97ec26d

Please sign in to comment.