Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Testing] refractor: param update E2E tests as integration tests #826

Merged
merged 121 commits into from
Sep 25, 2024
Merged
Changes from 1 commit
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
3a7315c
test: make stake_supplier.feature idempotent
bryanchriswhite Sep 11, 2024
9706877
test: speed up stake_supplier.feature
bryanchriswhite Sep 11, 2024
f2ec505
chore: simplification
bryanchriswhite Sep 11, 2024
e5672c1
chore: fix typos
bryanchriswhite Sep 11, 2024
597f75f
refactor: supplier feature steps
bryanchriswhite Sep 12, 2024
f90c752
refactor: rename paramsAnyMap type
bryanchriswhite Sep 12, 2024
526113b
chore: add comment
bryanchriswhite Sep 12, 2024
054d906
chore: add missing param update assertions
bryanchriswhite Sep 12, 2024
8b703c0
refactor: event waiting test helpers
bryanchriswhite Sep 12, 2024
ba1893c
feat: add supplier staking events
bryanchriswhite Sep 12, 2024
d3d51be
fix: test assertion expectation type
bryanchriswhite Sep 12, 2024
adfe8b8
refactor: integration app's base app & db construction
bryanchriswhite Sep 13, 2024
7aeb2e9
refactor: expose integration app's PreGeneratedAccountsIterator
bryanchriswhite Sep 13, 2024
f8cfdbe
refactor: add WithErrorAssertion run config option for integration app
bryanchriswhite Sep 13, 2024
dbd2402
refactor: add authz to integration app
bryanchriswhite Sep 13, 2024
e3725e4
test: begin refactoring update params E2E tests as integration tests
bryanchriswhite Sep 13, 2024
e842a09
wip: refactor: integraiton test suites to improve composability & reu…
bryanchriswhite Sep 13, 2024
8c94aec
wip: refactor: MsgUpdateParam E2E suite as integration suite
bryanchriswhite Sep 13, 2024
2833b6c
wip: test: debugging
bryanchriswhite Sep 13, 2024
98db79c
refactor: integration app base app construction
bryanchriswhite Sep 16, 2024
1908e10
fix: set default params for all poktroll modules
bryanchriswhite Sep 16, 2024
fdb2b91
chore: expose integration app's pre-generated account iterator
bryanchriswhite Sep 16, 2024
03f2de8
chore: add faucet account to integration app
bryanchriswhite Sep 16, 2024
9f38fb1
chore: add error assertion run option to integration app
bryanchriswhite Sep 16, 2024
61e5598
chore: add authz & bank modules to integration app
bryanchriswhite Sep 16, 2024
da70a08
feat: add IntegrationAppSuite & base implementation
bryanchriswhite Sep 16, 2024
942d381
Merge branch 'main' into issues/799/e2e/idempotent-stake-supplier
bryanchriswhite Sep 16, 2024
d5be66d
chore: rename paramsAnyMap type to mitigate variable name shadowing
bryanchriswhite Sep 16, 2024
36dc18d
chore: rename var
bryanchriswhite Sep 16, 2024
4f3664e
Merge branch 'main' into issues/799/e2e/idempotent-stake-supplier
Olshansk Sep 18, 2024
64c5a83
refactor: integration app to support txResult events
bryanchriswhite Sep 18, 2024
e73aa98
chore: extend IntegrationAppSuite
bryanchriswhite Sep 18, 2024
6e7832a
refactor: add IntegrationAppConfig/Options & genesis support
bryanchriswhite Sep 18, 2024
45730d2
fixup: HEAD^
bryanchriswhite Sep 18, 2024
06aa65e
chore: improvements & godoc comments
bryanchriswhite Sep 19, 2024
907b5c3
fix: tokenomics tests, RunMsgs, & NextBlock()
bryanchriswhite Sep 19, 2024
fb1c61b
chore: self-review improvements
bryanchriswhite Sep 19, 2024
d9e9c28
Merge remote-tracking branch 'pokt/main' into issues/799/refactor/int…
bryanchriswhite Sep 19, 2024
21e306e
fix: linter errors
bryanchriswhite Sep 19, 2024
1daf42c
fix: linter errors
bryanchriswhite Sep 19, 2024
2f1af15
Merge remote-tracking branch 'pokt/main' into issues/799/e2e/idempote…
bryanchriswhite Sep 19, 2024
7e71c38
fix: failing E2E test
bryanchriswhite Sep 19, 2024
ba7aaa7
chore: sync shared module default params
bryanchriswhite Sep 19, 2024
5c46e3d
chore: add comment
bryanchriswhite Sep 19, 2024
a2ee2c2
Merge branch 'issues/799/e2e/idempotent-stake-supplier' into issues/7…
bryanchriswhite Sep 19, 2024
3324d17
chore: review feedback improvements
bryanchriswhite Sep 19, 2024
8546244
Merge branch 'issues/799/e2e/param-helpers' into issues/799/feat/supp…
bryanchriswhite Sep 19, 2024
dfb5c05
Merge branch 'issues/799/feat/supplier-stake-events' into issues/799/…
bryanchriswhite Sep 19, 2024
7d4caf9
Merge branch 'issues/799/refactor/integration-app' into issues/799/me…
bryanchriswhite Sep 19, 2024
ba5e052
Merge branch 'issues/799/merge/integration-app_x_sup-stake-evts' into…
bryanchriswhite Sep 19, 2024
4c1c962
fix: update_param e2e test
bryanchriswhite Sep 19, 2024
5f0750a
Merge branch 'issues/799/e2e/idempotent-stake-supplier' into issues/7…
bryanchriswhite Sep 19, 2024
392a23b
Merge branch 'issues/799/e2e/param-helpers' into issues/799/feat/supp…
bryanchriswhite Sep 19, 2024
7cfb00c
chore: add unbonding_height fields & missing JSON tags
bryanchriswhite Sep 19, 2024
08c9b5d
chore: review improvements
bryanchriswhite Sep 19, 2024
8b98715
fix: failing tests
bryanchriswhite Sep 20, 2024
bedc05c
fix: failing tests
bryanchriswhite Sep 20, 2024
8d27279
Merge branch 'issues/799/e2e/idempotent-stake-supplier' into issues/7…
bryanchriswhite Sep 20, 2024
2877614
fix: failing tests
bryanchriswhite Sep 20, 2024
3effa0b
Merge branch 'issues/799/e2e/idempotent-stake-supplier' into issues/7…
bryanchriswhite Sep 20, 2024
68a0805
Merge branch 'issues/799/e2e/param-helpers' into issues/799/feat/supp…
bryanchriswhite Sep 20, 2024
ccced85
Merge branch 'issues/799/feat/supplier-stake-events' into issues/799/…
bryanchriswhite Sep 20, 2024
8fa1be4
chore: regenerate protobufs
bryanchriswhite Sep 20, 2024
0a0ad4e
Merge branch 'issues/799/feat/supplier-stake-events' into issues/799/…
bryanchriswhite Sep 20, 2024
18dbd04
Merge branch 'issues/799/merge/integration-app_x_sup-stake-evts' into…
bryanchriswhite Sep 20, 2024
53d5fcb
chore: review feedback improvements
bryanchriswhite Sep 20, 2024
836bbe3
fixup: HEAD^
bryanchriswhite Sep 20, 2024
55da2e3
Merge branch 'issues/799/refactor/integration-app' into issues/799/me…
bryanchriswhite Sep 20, 2024
0e3941f
Merge branch 'issues/799/merge/integration-app_x_sup-stake-evts' into…
bryanchriswhite Sep 20, 2024
912c09e
fix: post-merge
bryanchriswhite Sep 20, 2024
c0847c2
fix: bugs discovered
bryanchriswhite Sep 20, 2024
f32d585
Merge remote-tracking branch 'pokt/issues/799/refactor/integration-ap…
bryanchriswhite Sep 20, 2024
51cc9fe
Merge branch 'issues/799/merge/integration-app_x_sup-stake-evts' into…
bryanchriswhite Sep 20, 2024
79b18da
chore: add missing build constraint
bryanchriswhite Sep 20, 2024
e05979b
Merge branch 'main' into issues/799/e2e/idempotent-stake-supplier
bryanchriswhite Sep 23, 2024
cbbef67
chore: review feedback improvements
bryanchriswhite Sep 23, 2024
34776cb
Merge remote-tracking branch 'pokt/main' into issues/799/refactor/int…
bryanchriswhite Sep 23, 2024
cf3e04c
resolve: merge conflict
bryanchriswhite Sep 23, 2024
2cda72a
wip: improvements...
bryanchriswhite Sep 23, 2024
24e7234
Empty commit
bryanchriswhite Sep 23, 2024
695ce7c
Merge branch 'issues/799/e2e/idempotent-stake-supplier' into issues/7…
bryanchriswhite Sep 23, 2024
4808996
Merge branch 'main' into issues/799/e2e/param-helpers
bryanchriswhite Sep 23, 2024
463b474
chore: cleanup & comment
bryanchriswhite Sep 23, 2024
a70a084
chore: delete E2E params tests
bryanchriswhite Sep 23, 2024
b77d6a1
Merge remote-tracking branch 'pokt/issues/799/refactor/integration-ap…
bryanchriswhite Sep 23, 2024
9ced306
Merge branch 'issues/799/merge/integration-app_x_sup-stake-evts' into…
bryanchriswhite Sep 23, 2024
730d19f
Merge remote-tracking branch 'pokt/main' into issues/799/e2e/param-he…
bryanchriswhite Sep 23, 2024
21f822b
fix: add missing steps and update module name for moved param
bryanchriswhite Sep 23, 2024
fa8a9b6
Merge branch 'issues/799/e2e/param-helpers' into issues/799/feat/supp…
bryanchriswhite Sep 23, 2024
d4d0014
Merge branch 'issues/799/feat/supplier-stake-events' into issues/799/…
bryanchriswhite Sep 23, 2024
43e5737
Merge branch 'issues/799/merge/integration-app_x_sup-stake-evts' into…
bryanchriswhite Sep 23, 2024
52003cd
fixup: HEAD^
bryanchriswhite Sep 23, 2024
97ed69c
Merge branch 'issues/799/e2e/param-helpers' into issues/799/feat/supp…
bryanchriswhite Sep 23, 2024
268d102
Merge branch 'issues/799/feat/supplier-stake-events' into issues/799/…
bryanchriswhite Sep 23, 2024
e848711
Merge branch 'issues/799/merge/integration-app_x_sup-stake-evts' into…
bryanchriswhite Sep 23, 2024
52902d9
chore: self-review improvements
bryanchriswhite Sep 23, 2024
8baccfc
Merge branch 'main' into issues/799/refactor/integration-app
Olshansk Sep 23, 2024
afd9a60
revert: unintentional unfactoring
bryanchriswhite Sep 23, 2024
1372cd3
chore: review feedback improvements
bryanchriswhite Sep 24, 2024
c77a0a8
chore: review feedback improvements
bryanchriswhite Sep 24, 2024
c9ab047
Merge branch 'main' into issues/799/refactor/integration-app
bryanchriswhite Sep 24, 2024
01ded7f
Merge branch 'issues/799/refactor/integration-app' into issues/799/me…
bryanchriswhite Sep 24, 2024
54b7a8c
Merge branch 'issues/799/merge/integration-app_x_sup-stake-evts' into…
bryanchriswhite Sep 24, 2024
05f0ba6
chore: remove integration build constraints
bryanchriswhite Sep 24, 2024
8783b17
chore: reconcile upstream
bryanchriswhite Sep 24, 2024
e0e757b
fix: linter errors
bryanchriswhite Sep 24, 2024
6590f76
fixup! HEAD^
bryanchriswhite Sep 24, 2024
c914a89
Merge branch 'issues/799/refactor/integration-app' into issues/799/me…
bryanchriswhite Sep 24, 2024
5965522
Merge branch 'issues/799/merge/integration-app_x_sup-stake-evts' into…
bryanchriswhite Sep 24, 2024
d3563f5
fix: linter errors
bryanchriswhite Sep 24, 2024
f4945c4
chore: unexport params test suites
bryanchriswhite Sep 24, 2024
a6c35a9
Merge branch 'main' into issues/799/refactor/integration-app
bryanchriswhite Sep 25, 2024
a995747
chore: review feedback improvements
bryanchriswhite Sep 25, 2024
c6e4fd7
fix: typo
bryanchriswhite Sep 25, 2024
0201369
chore: review feedback improvements
bryanchriswhite Sep 25, 2024
a821cf4
chore: code review improvements
bryanchriswhite Sep 25, 2024
27837ca
chore: review feedback improvements
bryanchriswhite Sep 25, 2024
4dfa301
chore: consolidate param docs
bryanchriswhite Sep 25, 2024
337ea68
Merge branch 'issues/799/refactor/integration-app' into issues/799/me…
bryanchriswhite Sep 25, 2024
09ed9a7
Merge branch 'issues/799/merge/integration-app_x_sup-stake-evts' into…
bryanchriswhite Sep 25, 2024
445b2f7
Merge remote-tracking branch 'pokt/main' into issues/799/tests/params
bryanchriswhite Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: add WithErrorAssertion run config option for integration app
bryanchriswhite committed Sep 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit f8cfdbedcebd57fb2bdf14e1e9d2ea40dec8bf70
18 changes: 17 additions & 1 deletion testutil/integration/app.go
Original file line number Diff line number Diff line change
@@ -678,6 +678,11 @@ func (app *App) RunMsg(t *testing.T, msg sdk.Msg, option ...RunOption) *codectyp
if cfg.AutomaticCommit {
defer func() {
_, err := app.Commit()
if cfg.ErrorAssertion != nil && err != nil {
cfg.ErrorAssertion(err)
return
}

require.NoError(t, err, "failed to commit")
app.nextBlockUpdateCtx()
}()
@@ -691,6 +696,12 @@ func (app *App) RunMsg(t *testing.T, msg sdk.Msg, option ...RunOption) *codectyp
Votes: []cmtabcitypes.VoteInfo{{}},
},
})

if cfg.ErrorAssertion != nil && err != nil {
cfg.ErrorAssertion(err)
return nil
}

require.NoError(t, err, "failed to finalize block")
app.emitEvents(t, finalizedBlockResponse)
}
@@ -700,10 +711,15 @@ func (app *App) RunMsg(t *testing.T, msg sdk.Msg, option ...RunOption) *codectyp
handler := app.MsgServiceRouter().Handler(msg)
require.NotNil(t, handler, "handler not found for message %s", sdk.MsgTypeURL(msg))

var response *codectypes.Any
msgResult, err := handler(*app.sdkCtx, msg)
if cfg.ErrorAssertion != nil && err != nil {
cfg.ErrorAssertion(err)
return nil
}

require.NoError(t, err, "failed to execute message %s", sdk.MsgTypeURL(msg))

var response *codectypes.Any
if len(msgResult.MsgResponses) > 0 {
msgResponse := msgResult.MsgResponses[0]
require.NotNil(t, msgResponse, "unexpected nil msg response %s in message result: %s", sdk.MsgTypeURL(msg), msgResult.String())
9 changes: 9 additions & 0 deletions testutil/integration/options.go
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ package integration
type RunConfig struct {
AutomaticFinalizeBlock bool
AutomaticCommit bool
ErrorAssertion func(error)
}

// RunOption is a function that can be used to configure the integration app.
@@ -23,3 +24,11 @@ func WithAutomaticCommit() RunOption {
cfg.AutomaticCommit = true
}
}

// WithErrorAssertion registers an error assertion function which is called when
// RunMsg() encounters an error.
func WithErrorAssertion(errAssertFn func(error)) RunOption {
return func(cfg *RunConfig) {
cfg.ErrorAssertion = errAssertFn
}
}