Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Conversation

@gyuho
Copy link
Contributor

@gyuho gyuho commented Dec 13, 2021

❯ ./scripts/integration.sh 
Running Suite: quarkvm integration test suites - /Users/gyuho.lee/go/src/github.com/ava-labs/quarkvm/tests/integration
======================================================================================================================
Random Seed: 1639620454

Will run 4 of 4 specs
------------------------------
[BeforeSuite] 
/Users/gyuho.lee/go/src/github.com/ava-labs/quarkvm/tests/integration/integration_test.go:88
INFO[12-15|18:07:36] initializing quarkvm                     version=v0.0.1
INFO[12-15|18:07:36] initialized quarkvm from genesis         block=cci4GwGvgrEu9L1LH6sPP9tx5o16pcJA7LLSbayWYEQhZwYRR
INFO[12-15|18:07:36] initializing quarkvm                     version=v0.0.1
INFO[12-15|18:07:36] initialized quarkvm from genesis         block=cci4GwGvgrEu9L1LH6sPP9tx5o16pcJA7LLSbayWYEQhZwYRR
INFO[12-15|18:07:36] initializing quarkvm                     version=v0.0.1
INFO[12-15|18:07:36] initialized quarkvm from genesis         block=cci4GwGvgrEu9L1LH6sPP9tx5o16pcJA7LLSbayWYEQhZwYRR
created 3 VMs
------------------------------
[BeforeSuite] PASSED [0.002 seconds]
[BeforeSuite] 
/Users/gyuho.lee/go/src/github.com/ava-labs/quarkvm/tests/integration/integration_test.go:88
------------------------------
[ClaimTx]
  get currently preferred block ID
  /Users/gyuho.lee/go/src/github.com/ava-labs/quarkvm/tests/integration/integration_test.go:162
•
------------------------------
[ClaimTx]
  fail ClaimTx with no block ID
  /Users/gyuho.lee/go/src/github.com/ava-labs/quarkvm/tests/integration/integration_test.go:169
•
------------------------------
[ClaimTx]
  ClaimTx with valid PoW
  /Users/gyuho.lee/go/src/github.com/ava-labs/quarkvm/tests/integration/integration_test.go:191
STEP: mine and accept block with the first ClaimTx 12/15/21 18:07:36.09
DBUG[12-15|18:07:36] attempting block building 
DBUG[12-15|18:07:36] verified block                           id=2QwBCVjmSdUbMB66NPmjmfY4SWLW3c1sk7Hq3aJk4JrxxMaWab parent=cci4GwGvgrEu9L1LH6sPP9tx5o16pcJA7LLSbayWYEQhZwYRR
DBUG[12-15|18:07:36] set preference                           id=2QwBCVjmSdUbMB66NPmjmfY4SWLW3c1sk7Hq3aJk4JrxxMaWab
DBUG[12-15|18:07:36] accepted block                           id=2QwBCVjmSdUbMB66NPmjmfY4SWLW3c1sk7Hq3aJk4JrxxMaWab
STEP: check prefix after ClaimTx has been accepted 12/15/21 18:07:36.094
STEP: check prefix after ClaimTx has been accepted 12/15/21 18:07:36.094
STEP: mine and accept block with a new SetTx 12/15/21 18:07:41.097
DBUG[12-15|18:07:41] attempting block building 
DBUG[12-15|18:07:41] verified block                           id=2qBeRcPNqVnYUFdDRyEtFpUjkrDDX1J4dFQ93za2Ac22reg5VE parent=2QwBCVjmSdUbMB66NPmjmfY4SWLW3c1sk7Hq3aJk4JrxxMaWab
DBUG[12-15|18:07:41] set preference                           id=2qBeRcPNqVnYUFdDRyEtFpUjkrDDX1J4dFQ93za2Ac22reg5VE
DBUG[12-15|18:07:41] accepted block                           id=2qBeRcPNqVnYUFdDRyEtFpUjkrDDX1J4dFQ93za2Ac22reg5VE
STEP: read back from VM with range query 12/15/21 18:07:41.1
INFO[12-15|18:07:41] range query for key %q and range end %q  LOG15_ERROR=
------------------------------
• [SLOW TEST] [5.011 seconds]
[ClaimTx]
/Users/gyuho.lee/go/src/github.com/ava-labs/quarkvm/tests/integration/integration_test.go:161
  ClaimTx with valid PoW
  /Users/gyuho.lee/go/src/github.com/ava-labs/quarkvm/tests/integration/integration_test.go:191

  Begin Captured GinkgoWriter Output >>
    STEP: mine and accept block with the first ClaimTx 12/15/21 18:07:36.09
    STEP: check prefix after ClaimTx has been accepted 12/15/21 18:07:36.094
    STEP: mine and accept block with a new SetTx 12/15/21 18:07:41.097
    STEP: read back from VM with range query 12/15/21 18:07:41.1
  << End Captured GinkgoWriter Output
------------------------------
[Ping]
  can ping
  /Users/gyuho.lee/go/src/github.com/ava-labs/quarkvm/tests/integration/integration_test.go:152
INFO[12-15|18:07:41] ping 
INFO[12-15|18:07:41] ping 
INFO[12-15|18:07:41] ping 

------------------------------
[AfterSuite] 
/Users/gyuho.lee/go/src/github.com/ava-labs/quarkvm/tests/integration/integration_test.go:143
------------------------------
[AfterSuite] PASSED [0.000 seconds]
[AfterSuite] 
/Users/gyuho.lee/go/src/github.com/ava-labs/quarkvm/tests/integration/integration_test.go:143
------------------------------

Ran 4 of 4 Specs in 5.018 seconds
SUCCESS! -- 4 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS

Ginkgo ran 1 suite in 6.127320071s
Test Suite Passed

@patrick-ogrady
Copy link
Contributor

You may be able to do this more easily using the testing style from coreth: https://github.com/ava-labs/coreth-internal/blob/25c525dc6e769b9f6262ac298f9894b39ba3b5d9/plugin/evm/vm_test.go#L429-L431

We don't actually spin up an HTTP endpoint but instead interface with the VM directly (not on a running network).

@gyuho
Copy link
Contributor Author

gyuho commented Dec 13, 2021

You may be able to do this more easily using the testing style from coreth: https://github.com/ava-labs/coreth-internal/blob/25c525dc6e769b9f6262ac298f9894b39ba3b5d9/plugin/evm/vm_test.go#L429-L431

Thanks for the pointers. I like the approach of running local VMs, and will look into that after this big PR #9 is reviewed (trying to see if we can even mock VM).

I believe there's still value in testing against real small network, considering them as blackbox. e.g., Send tx to node A, and make sure node B acks and agrees. I can work on these in parallel.

@gyuho gyuho changed the title e2e: basic conformance tests with ginkgo [AV-1053] basic conformance/e2e tests with ginkgo Dec 14, 2021
@gyuho gyuho changed the title [AV-1053] basic conformance/e2e tests with ginkgo [AV-1053] *: clean up + basic e2e/integration tests Dec 15, 2021
vm: fix "IssueTx" reply

Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
@gyuho gyuho changed the title [AV-1053] *: clean up + basic e2e/integration tests [AV-1117] *: clean up + basic e2e/integration tests Dec 16, 2021

graffiti := uint64(0)
for ctx.Err() == nil {
valid, err := cli.CheckBlock(cbID)
Copy link
Contributor

Choose a reason for hiding this comment

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

In a future PR, we should do this more periodically to speed up the mining loop.

return nil, err
}
d := pow.Difficulty(b)
est, err := cli.EstimateDifficulty()
Copy link
Contributor

Choose a reason for hiding this comment

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

In a future PR, we should do this more periodically to speed up the mining loop.

break
}
confirmed, err := cli.PollTx(ctx, txID)
cancel()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we explicitly need to cancel this?

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 would say this is just for a good practice in case PollTx spawns its own goroutine after returning. Technically, not needed.

httpServer *httptest.Server
}

var _ = ginkgo.BeforeSuite(func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

fancy fancy

}
}

opts := []client.OpOption{client.WithPollTx()}
Copy link
Contributor

Choose a reason for hiding this comment

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

Fancy variadic functions

Copy link
Contributor

@patrick-ogrady patrick-ogrady left a comment

Choose a reason for hiding this comment

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

LGTM

@gyuho gyuho merged commit caa0204 into ava-labs:master Dec 17, 2021
@gyuho gyuho deleted the full-e2e branch December 17, 2021 08:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants