predeploy-contracts icon indicating copy to clipboard operation
predeploy-contracts copied to clipboard

Add e2e tests

Open ThunderDeliverer opened this issue 4 years ago • 7 comments
trafficstars

Add end-to-end tests

This branch introduces tests to the predeployed contracts and migrates from Truffle to Waffle.

The changes are separated in branches:

  • Migrate from Truffle to Waffle
    • Includes addition of packages and small configuration changes
  • Add Token test
    • Test suite to test the token contracts
  • Add DEX test
    • Test suite to test the DEX contract
  • Add Oracle test
    • Test suite to test the oracle contract
  • Add Schedule test
    • Test suite to test the schedule contract
  • Add StateRent test
    • Test suite to test the state rent contract

NOTE: I'll keep this in draft until the suite is ready.

ThunderDeliverer avatar Sep 28 '21 00:09 ThunderDeliverer

Maybe it would be better to put all e2e tests here. @xlc https://github.com/AcalaNetwork/Acala/pull/1437

zjb0807 avatar Sep 28 '21 02:09 zjb0807

yeah I think it make sense to have this merged with the one in Acala main repo.

xlc avatar Sep 28 '21 22:09 xlc

Sure, I'll merge it (through a new PR) once I'm done with the tests. Should be tomorrow.

ThunderDeliverer avatar Sep 29 '21 00:09 ThunderDeliverer

Maybe it would be better to put all e2e tests here. @xlc AcalaNetwork/Acala#1437

I've been thinking about this. Maybe it would make sense to add these tests to both repositories? We have them and it's good to use them wherever we can. What do you to think @xlc and @zjb0807 ?

Actually the more I think about it, the more sense it makes for the tests to be here. They will be added to AcalaNetwork/Acala repository once the reference to this repository gets updated.

ThunderDeliverer avatar Oct 04 '21 00:10 ThunderDeliverer

We need the tests in Acala repo so it can be ran by CI

xlc avatar Oct 04 '21 02:10 xlc

I could open up a PR to add the tests contained in the predeploy-contracts repository to the CI in Acala:

.PHONY: test-predeployed
test-predeployed:
	cargo build --features with-mandala-runtime
	cd predeploy-contracts && yarn && yarn build && yarn test

ThunderDeliverer avatar Oct 04 '21 19:10 ThunderDeliverer

I am ok to have this merged and then we can see if we want to improve the workflow.

xlc avatar Oct 04 '21 22:10 xlc