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 improvements #335

Closed
13 of 14 tasks
ivoysey opened this issue May 24, 2021 · 3 comments · Fixed by #408
Closed
13 of 14 tasks

testing improvements #335

ivoysey opened this issue May 24, 2021 · 3 comments · Fixed by #408
Assignees

Comments

@ivoysey
Copy link
Collaborator

ivoysey commented May 24, 2021

  • allow for tests with input
  • allow for tests that have return type other than int
  • test fib(5)
  • refactor test script so that you have one json file that describes all the tests to run instead of one file per test, now that there are a lot of tests.
  • check the output from curl commands in an exhaustive way
  • deal with broken json files in a graceful way?
  • output a summary of how many tests passed and failed and which ones failed on Travis
  • output a warning if there are .obs files without a .json file (meaning test that are there but not being run)
  • look for ways to make the tests take less time to run (shared work getting repeated, etc.)

this subsumes #302

as of 2 June, these tests are defined but do not have JSON so are not getting run (because they don't pass):

additionally,

@ivoysey ivoysey self-assigned this May 24, 2021
ivoysey added a commit that referenced this issue May 26, 2021
* formatting the test, removing old code

* new test case with less going on

* updating primops test case to use local vars not fields

* scala style, whitespace, a new util function, comments, variable declaration first cut

* updating bool literal test to refer to a local rather than a field

* no prizes for guessing where i copied this file from

* assign instead of declare; removing type annotations from declarations output with a comment about why

* whitespace

* similar enough case for decls, so might as well

* updating ifthenelse test case to use locals not fields, fixing a bug in the output code

* adding case for if, since it\'s so similar to ifthenelse

* intconst test to locals not fields

* removing sstore for local variables

* fixing scaladocs

* updating simplecall test to  not use fields

* adding a top level return to simple call so its testable

* scala style

* adding a slightly hacky script to run all the ganache tests locally in one pass, emulating what will happen in Travis without quite as much overhead

* scraps

* better shell scripting practices

* more shell tweaks

* Adding some logic to make local testing of specific files easier

* shell script hacking; this will likely break on travis beacuse of unresolved issues with jq

* moving a comment around; it's valid scala to have it where it was, but the IDE doesn't know how to parse it

* whitespace and comments in testing script

* adding a call to eth_call and a check on the result

* updating travis build to include sha3 utility

* fixed a type in a bash variable name, updated the hash implemention i'm using, now computing the right hash at least

* possibly better travis install commands

* apt command change

* adding rhash to the build, to see if that works better

* more hashing attempts

* code to pick between which hash implementation based on uname

* cutting hash to first 8 bytes in travis, adding messages

* updating call to use the contract address

* stripping quotes off the contract address, adding a dire warning about missing JSON fields, moving latest out of the dictionary part of the params object

* guarded hack for running something locally, but i still want to spin up travis for the end of the day

* Adding more gas; updating check on testexp and expected so it warns (at least textually; return value is unchanged); updating hostname check so it works

* found a duplicated 0x with michael

* checking against expected

* comments

* Adding check on getTransactionRecipt status code

* Adding check on getTransactionRecipt status code

* updating comments on testing script

* removing redundant braces, some binaries from solidity code for local testing, using an easier allocation function

* commenting out the failure count incrementer so i can check travis for all the tests

* off by one error

* removing binaries for local testing and commented line from travis script

* fixed a bug with not assigning back to the temp var in the function call case; the simplecall test now passes

* fixing Return test

* updating Travis travis script to only make a call to eth_call if the JSON describing a test includes an expression to call and to mark it as an error if eth_call gets an error back

* adding test expected values to other simple tests

* test script output

* breaking primops test up into one test per operator

* copy paste typos

* typos, small fixes

* splitting subtraction test into two cases

* typos

* adding a rough summary of what passed and failed to the output for readability in travis

* quick summary

* updating codegen to fix logical negation, which entailed fixing bugs in if-then-else and the call to translate expression from translate statement

* actually fixing the bug in if-then-else; adding a new test case that showed it to me

* removing the json file for a failing test per #337 and #335

* removing JSON per #338

* adding a simple script that tells me which tests are defined but without json so they aren't being run

* adding a warning about skipped tests

* Adding comments to convenience shell scripts
@ivoysey
Copy link
Collaborator Author

ivoysey commented Jun 2, 2021

@mcoblenz do you have any thoughts for low hanging fruit for how to speed up the test run? like caching we could be doing? i know that sbt gets run once per JSON file in the GanacheTests directory, and it takes some time to notice that it doesn't need to do any work to rebuild Obsidian each time, for instance. it's not clear to me that sbt really needs to be run more than once for the whole test suite, but maybe that's aggressive.

the full run of a CI pass is taking something like 20 mins and it's starting to be a burden; i can run the tests locally first, but want to see them pass in Travis before merging a branch into master, for instance.

@ivoysey
Copy link
Collaborator Author

ivoysey commented Jun 8, 2021

this commit ba1a07b seems to make the tests only get run by sbt in one branch through the travis jobs but not both.

@ivoysey
Copy link
Collaborator Author

ivoysey commented Dec 11, 2021

i'm going to close this issue once #408 gets merged. it's too big and most of it's been done; i've broken out what hasn't into smaller issues and it's all pretty low priority, but this big monolithic thing has served its purpose.

@ivoysey ivoysey linked a pull request Dec 11, 2021 that will close this issue
@ivoysey ivoysey closed this as completed Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant