Skip to content

Commit

Permalink
Fixing double partitioned tests
Browse files Browse the repository at this point in the history
  • Loading branch information
algojack committed Sep 8, 2021
1 parent 7a0c2b5 commit 4ae2738
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 17 deletions.
33 changes: 22 additions & 11 deletions daemon/algod/api/server/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,16 @@ func (s *TestSuite) SetupTest() {
s.calls = 0
}
func (s *TestSuite) TestBaselineRoute() {
partitiontest.PartitionTest(s.T())
// partitiontest.PartitionTest(s.T())
// Partitioning in TestTestSuite()
ctx := s.e.NewContext(nil, nil)
s.e.Router().Find(http.MethodGet, "/v0/this/is/no/endpoint", ctx)
assert.Equal(s.T(), echo.ErrNotFound, ctx.Handler()(ctx))
assert.Equal(s.T(), 0, s.calls)
}
func (s *TestSuite) TestAccountPendingTransaction() {
partitiontest.PartitionTest(s.T())
// partitiontest.PartitionTest(s.T())
// Partitioning in TestTestSuite()
ctx := s.e.NewContext(nil, nil)
s.e.Router().Find(http.MethodGet, "/v1/account/address-param/transactions/pending", ctx)
assert.Equal(s.T(), "/v1/account/:addr/transactions/pending", ctx.Path())
Expand All @@ -75,7 +77,8 @@ func (s *TestSuite) TestAccountPendingTransaction() {
assert.Equal(s.T(), callsBefore+1, s.calls)
}
func (s *TestSuite) TestWaitAfterBlock() {
partitiontest.PartitionTest(s.T())
// partitiontest.PartitionTest(s.T())
// Partitioning in TestTestSuite()
ctx := s.e.NewContext(nil, nil)
s.e.Router().Find(http.MethodGet, "/v1/status/wait-for-block-after/123456", ctx)
assert.Equal(s.T(), "/v1/status/wait-for-block-after/:round", ctx.Path())
Expand All @@ -87,7 +90,8 @@ func (s *TestSuite) TestWaitAfterBlock() {
assert.Equal(s.T(), callsBefore+1, s.calls)
}
func (s *TestSuite) TestAccountInformation() {
partitiontest.PartitionTest(s.T())
// partitiontest.PartitionTest(s.T())
// Partitioning in TestTestSuite()
ctx := s.e.NewContext(nil, nil)
s.e.Router().Find(http.MethodGet, "/v1/account/ZBBRQD73JH5KZ7XRED6GALJYJUXOMBBP3X2Z2XFA4LATV3MUJKKMKG7SHA", ctx)
assert.Equal(s.T(), "/v1/account/:addr", ctx.Path())
Expand All @@ -99,7 +103,8 @@ func (s *TestSuite) TestAccountInformation() {
assert.Equal(s.T(), callsBefore+1, s.calls)
}
func (s *TestSuite) TestTransactionInformation() {
partitiontest.PartitionTest(s.T())
// partitiontest.PartitionTest(s.T())
// Partitioning in TestTestSuite()
ctx := s.e.NewContext(nil, nil)
addr := "ZBBRQD73JH5KZ7XRED6GALJYJUXOMBBP3X2Z2XFA4LATV3MUJKKMKG7SHA"
txid := "ASPB5E72OT2UWSOCQGD5OPT3W4KV4LZZDL7L5MBCC3EBAIJCDHAA"
Expand All @@ -114,7 +119,8 @@ func (s *TestSuite) TestTransactionInformation() {
assert.Equal(s.T(), callsBefore+1, s.calls)
}
func (s *TestSuite) TestAccountTransaction() {
partitiontest.PartitionTest(s.T())
// partitiontest.PartitionTest(s.T())
// Partitioning in TestTestSuite()
ctx := s.e.NewContext(nil, nil)
addr := "ZBBRQD73JH5KZ7XRED6GALJYJUXOMBBP3X2Z2XFA4LATV3MUJKKMKG7SHA"
s.e.Router().Find(http.MethodGet, "/v1/account/"+addr+"/transactions", ctx)
Expand All @@ -127,7 +133,8 @@ func (s *TestSuite) TestAccountTransaction() {
assert.Equal(s.T(), callsBefore+1, s.calls)
}
func (s *TestSuite) TestBlock() {
partitiontest.PartitionTest(s.T())
// partitiontest.PartitionTest(s.T())
// Partitioning in TestTestSuite()
ctx := s.e.NewContext(nil, nil)
s.e.Router().Find(http.MethodGet, "/v1/block/123456", ctx)
assert.Equal(s.T(), "/v1/block/:round", ctx.Path())
Expand All @@ -139,7 +146,8 @@ func (s *TestSuite) TestBlock() {
assert.Equal(s.T(), callsBefore+1, s.calls)
}
func (s *TestSuite) TestPendingTransactionID() {
partitiontest.PartitionTest(s.T())
// partitiontest.PartitionTest(s.T())
// Partitioning in TestTestSuite()
ctx := s.e.NewContext(nil, nil)
txid := "ASPB5E72OT2UWSOCQGD5OPT3W4KV4LZZDL7L5MBCC3EBAIJCDHAA"
s.e.Router().Find(http.MethodGet, "/v1/transactions/pending/"+txid, ctx)
Expand All @@ -152,7 +160,8 @@ func (s *TestSuite) TestPendingTransactionID() {
assert.Equal(s.T(), callsBefore+1, s.calls)
}
func (s *TestSuite) TestPendingTransactionInformationByAddress() {
partitiontest.PartitionTest(s.T())
// partitiontest.PartitionTest(s.T())
// Partitioning in TestTestSuite()
ctx := s.e.NewContext(nil, nil)
addr := "ZBBRQD73JH5KZ7XRED6GALJYJUXOMBBP3X2Z2XFA4LATV3MUJKKMKG7SHA"
s.e.Router().Find(http.MethodGet, "/v1/account/"+addr+"/transactions/pending", ctx)
Expand All @@ -165,7 +174,8 @@ func (s *TestSuite) TestPendingTransactionInformationByAddress() {
assert.Equal(s.T(), callsBefore+1, s.calls)
}
func (s *TestSuite) TestGetAsset() {
partitiontest.PartitionTest(s.T())
// partitiontest.PartitionTest(s.T())
// Partitioning in TestTestSuite()
ctx := s.e.NewContext(nil, nil)
s.e.Router().Find(http.MethodGet, "/v1/asset/123456", ctx)
assert.Equal(s.T(), "/v1/asset/:index", ctx.Path())
Expand All @@ -177,7 +187,8 @@ func (s *TestSuite) TestGetAsset() {
assert.Equal(s.T(), callsBefore+1, s.calls)
}
func (s *TestSuite) TestGetTransactionByID() {
partitiontest.PartitionTest(s.T())
// partitiontest.PartitionTest(s.T())
// Partitioning in TestTestSuite()
ctx := s.e.NewContext(nil, nil)
txid := "ASPB5E72OT2UWSOCQGD5OPT3W4KV4LZZDL7L5MBCC3EBAIJCDHAA"
s.e.Router().Find(http.MethodGet, "/v1/transaction/"+txid, ctx)
Expand Down
4 changes: 2 additions & 2 deletions test/e2e-go/cli/algoh/expect/algoh_expect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import (
"testing"

"github.com/algorand/go-algorand/test/framework/fixtures"
"github.com/algorand/go-algorand/test/partitiontest"
)

// TestAlgohWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/algoh/expect directory
func TestAlgohWithExpect(t *testing.T) {
partitiontest.PartitionTest(t)
// partitiontest.PartitionTest(t)
// Causes double partition, so commented out on purpose
et := fixtures.MakeExpectTest(t)
et.Run()
}
4 changes: 2 additions & 2 deletions test/e2e-go/cli/goal/expect/goal_expect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import (
"testing"

"github.com/algorand/go-algorand/test/framework/fixtures"
"github.com/algorand/go-algorand/test/partitiontest"
)

// TestGoalWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/goal/expect directory
func TestGoalWithExpect(t *testing.T) {
partitiontest.PartitionTest(t)
// partitiontest.PartitionTest(t)
// Causes double partition, so commented out on purpose
et := fixtures.MakeExpectTest(t)
et.Run()
}
4 changes: 2 additions & 2 deletions test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import (
"testing"

"github.com/algorand/go-algorand/test/framework/fixtures"
"github.com/algorand/go-algorand/test/partitiontest"
)

// TestTealdbgWithExpect processes all expect script files with suffix Test.exp within the test/e2e-go/cli/tealdbg/expect directory
func TestTealdbgWithExpect(t *testing.T) {
partitiontest.PartitionTest(t)
// partitiontest.PartitionTest(t)
// Causes double partition, so commented out on purpose
et := fixtures.MakeExpectTest(t)
et.Run()
}

0 comments on commit 4ae2738

Please sign in to comment.