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

Automate tests #1

Open
mdbenito opened this issue May 7, 2021 · 2 comments
Open

Automate tests #1

mdbenito opened this issue May 7, 2021 · 2 comments
Labels
good first issue Good for newcomers

Comments

@mdbenito
Copy link
Contributor

mdbenito commented May 7, 2021

Currently tests/run.scm just converts files in subdirectories but doesn't check anything. We need to compare the output against the reference, either with diff or using scheme. diff might be better if we have CI, because installing and running texmacs headless for CI might range from complicated to an ordeal. Conversions could be done with a commit hook, and the pipeline would fail if tm files are newer than the md files. It's not rock solid automation, but better than nothing.

@mgubi
Copy link

mgubi commented May 7, 2021

In TeXmacs there is some code to do testing. See e.g. for the HTML converter. Wouldn't be better to integrate the testing in Scheme, in particular to perform the comparison of the output at the level of trees? I never did CI, how does it work? Do we have a stable image or the image is created every time the process run? Run headless on Unix is not a problem using a virtual X server, we do already for the TeXmacs server in Bonn.

@mdbenito
Copy link
Contributor Author

mdbenito commented May 7, 2021

Yes, I saw the tests, but it seemed quite specific to that converter and disentangling it way too much work (at least at first sight). I wasn't aiming so much for unit tests as for "larger" regression tests, where I test a bunch of functionality and how it ties together. Just a compromise for the sake of simplicity since for this simple converter it often suffices (sufficed?) to see that some conversion failed in order to spot the problem. If anyone is willing to do the heavy lifting, we can have more fine-grained tests too, of course.

As to the CI: github runs its "actions" (pipelines) in runners hosted by them, basically VMs with some stuff preconfigured. There are Linux, Windows and Mac runners, so it might just be easier to use the latter, but e.g. on ubuntu, one can just run apt-get to update and install packages. Because that's quite wasteful to do on each push to the repo, and because there is a 2000 minute/month time limit for running actions, one could pre-build a docker image (with e.g. the latest TeXmacs stable release), push it to dockerhub and use it instead of the default environments provided by github.

@mdbenito mdbenito added the good first issue Good for newcomers label Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants