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

app: add teku simnet integration test #271

Merged
merged 14 commits into from
Mar 24, 2022
Merged

app: add teku simnet integration test #271

merged 14 commits into from
Mar 24, 2022

Conversation

corverroos
Copy link
Contributor

Adds an simnet integration test that uses teku as validator client.

  • Integration test always run if docker found (best effort)
  • Can use --integration flag to force the test
  • Support shutting down beacon mock http server.

category: test
ticket: #268

@codecov
Copy link

codecov bot commented Mar 24, 2022

Codecov Report

Merging #271 (cd46873) into main (d21724c) will decrease coverage by 0.40%.
The diff coverage is 30.23%.

❗ Current head cd46873 differs from pull request most recent head d428745. Consider uploading reports for the commit d428745 to get more accurate results

@@            Coverage Diff             @@
##             main     #271      +/-   ##
==========================================
- Coverage   58.50%   58.10%   -0.41%     
==========================================
  Files          53       53              
  Lines        3974     4000      +26     
==========================================
- Hits         2325     2324       -1     
- Misses       1329     1350      +21     
- Partials      320      326       +6     
Impacted Files Coverage Δ
app/lifecycle/manager.go 74.56% <0.00%> (ø)
app/lifecycle/orderstop_string.go 83.33% <ø> (ø)
core/validatorapi/router.go 62.50% <0.00%> (-0.87%) ⬇️
testutil/beaconmock/beaconmock.go 51.16% <11.11%> (-11.70%) ⬇️
testutil/beaconmock/server.go 57.89% <29.41%> (-5.22%) ⬇️
app/app.go 60.07% <50.00%> (-1.14%) ⬇️
testutil/beaconmock/options.go 57.54% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d21724c...d428745. Read the comment docs.

Copy link
Contributor

@dB2510 dB2510 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

func TestSimnetNoNetwork(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
//go:generate go test . -run=TestSimnetNoNetwork_TekuVC -integration -v
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we name run flag as -run=test_teku_simnet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding another test for lighthouse as well, so not sure two flags are required

@@ -62,6 +63,9 @@ type staticOverride struct {

// newHTTPServer returns a beacon API mock http server.
func newHTTPServer(addr string, overrides ...staticOverride) (*http.Server, error) {
debug := os.Getenv("BEACONMOCK_DEBUG") == "true" // NOTE: These logs are verbose, so disabled by default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we have introduced this ENV variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is test code, I wanted the option to be able to debug httpserver stuff with this logging, but it is very verbose... not sure how else.

@corverroos corverroos merged commit e06b289 into main Mar 24, 2022
@corverroos corverroos deleted the corver/simnetteku branch March 24, 2022 14:53
corverroos added a commit that referenced this pull request Mar 25, 2022
Default to gnosis as preset base. This provides shorter slots_per_epoch for lighthouse in simnet. Default to 1s slot duration. See sigp/lighthouse#3033 for reference.

category: test
ticket: #271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants