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

End-to-end test framework #38

Closed
andorp opened this issue Jul 17, 2019 · 1 comment
Closed

End-to-end test framework #38

andorp opened this issue Jul 17, 2019 · 1 comment
Assignees
Labels
accepted The proposal is accepted. proposal A suggestion on how to improve the compiler

Comments

@andorp
Copy link
Member

andorp commented Jul 17, 2019

Currently there are simple unit tests as part of the testing process. I would like to extend this with an end-to-end approach similar I implemented in the idris-grin test library.

The current situation we have:
We run unit tests using Hspec and report the coverage of the result. After the unit tests we run the grin compiler on the sum_simple example. The build fails if there are test failures or some exception during the compilation of the sum_simple.grin. The output of the sum_simple compilation is never checked. As the project grows an gains popularity and user base we need a more thorough testing.

The use-case for this extension is already discussed:

  • It would be good to maintain a set of example grin files in the repository and use them during the development and after during part of the regression testing
  • Test cases from x-grin back-ends would be easily added to the future regression suite

I propose the following: The end-to-end test suite should

  • run after the unit test phase
  • have a test data directory where all the test grin files should live
  • be able to read the grin files from textual or binary format
  • grin files which have main modules should be interpreted (see details below)
  • grin files which does not have main should have an option yaml file which sets the pipeline options and an expected output file
  • add to the coverage report

Interpreted tests: The end-to-end suite should

  • run the interpreter on the test grin file without any optimizations, save the output as expected result
  • run the interpreter on the test grin file with the optimization pipeline, and compare the output with the expected output. If there is a difference it should bisect the intermediate optimization steps to pinpoint the where the output started to diverge from the expected.
  • generate an executable from the optimized version and check the output against the expected.

Thoughts on the binary format: Binary input format is not preferred. Currently it is a short cut to overcome some issues in the parser. Backward compatibility for the end-to-end tests are not required. Whenever we will need to use binary format in the end-to-end test suite it indicates some regression in the parser. After fixing the regression in the parser the binary stored test data should be converted to textual grin. This can be done using the grin compiler.

@andorp andorp added the proposal A suggestion on how to improve the compiler label Jul 17, 2019
@andorp
Copy link
Member Author

andorp commented Jul 17, 2019

Please review and comment.

@andorp andorp added the accepted The proposal is accepted. label Jul 19, 2019
@andorp andorp assigned andorp and unassigned csabahruska and Anabra Jul 25, 2019
@andorp andorp mentioned this issue Jul 25, 2019
@andorp andorp closed this as completed Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The proposal is accepted. proposal A suggestion on how to improve the compiler
Projects
None yet
Development

No branches or pull requests

3 participants