gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + gno.land: a blockchain for timeless code and fair open-source.
https://gno.land/
Other
899 stars 377 forks source link

Machine context reset breaks tests #3180

Open Kouteki opened 3 days ago

Kouteki commented 3 days ago

Description

We introduced https://github.com/gnolang/gno/pull/2975 to wipe the machine context before each test. The problem is that Onbloc has 90+ tests that now have to be run sequentially, and roughly half of the tests require context to be retained (e.g. block height):

  1. TestFunc2 gets affected by behavior in TestFunc1
  2. if TestFunc1 changes, we need to change every test code (because for gnoswap we need to check every number(token amount)

Example:

gnoswap staker tc

We should consider introducing an override for machine context.

Related https://github.com/gnolang/gno/issues/1982