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

Basic CI integration #364

Merged
merged 3 commits into from
Nov 18, 2022
Merged

Basic CI integration #364

merged 3 commits into from
Nov 18, 2022

Conversation

MisterDA
Copy link
Collaborator

This PR attempts to do simple integration from Alcotest to CI systems. For now, Alcotest detects the CI system using the CI, GITHUB_ACTIONS, or OCAMLCI environment variables. As a first showcase of what we can do, when detecting GitHub Actions it will output annotations allowing to fold/unfold a test suite in the web interface. When detecting it's running in CI, Alcotest will also enable the show_errors modes (this can be overridden via the API) so that all failing tests are displayed in the CI (otherwise users would have to fix the failing test, push, and so on, to see the other errors).
I plan to expand the features if this PR is well received.

@samoht
Copy link
Member

samoht commented Nov 17, 2022

I think you forgot to promote the expect test outputs - might be worth being explicit if these environment variables are set in the tests (so we can also check these are working as expected).

This allows to show all the errors in the CI logs if multiple tests
are failing.

Alcotest tests themselves are not run as if they were run in CI.
@MisterDA
Copy link
Collaborator Author

I think you forgot to promote the expect test outputs - might be worth being explicit if these environment variables are set in the tests (so we can also check these are working as expected).

I've set CI=false in the environment of the tests. Testing the CI will likely need to duplicate the tests. As the features are quite simple for now, maybe that can be done later?

@MisterDA
Copy link
Collaborator Author

For reference, this is the language GitHub Actions uses for annotations: Workflow commands for GitHub Actions.
Here's an open feature request of mine: Grouping log lines: set the folded/unfolded state with ::endgroup:: at the end of the logs.

@samoht samoht merged commit 6e45595 into mirage:main Nov 18, 2022
@samoht
Copy link
Member

samoht commented Nov 18, 2022

Many thanks!

@MisterDA MisterDA deleted the ci-integration branch November 18, 2022 12:15
samoht added a commit to samoht/opam-repository that referenced this pull request Feb 24, 2023
…d alcotest-async (1.7.0)

CHANGES:

- compile with MSVC (mirage/alcotest#369, @jonahbeckfordm review by @TheLortex
  and @MisterDA)

- Allow skipping a test case from inside the test case (mirage/alcotest#368, @apeschar)

- Fix compilation on bytecode architectures (mirage/alcotest#335, @glondu)

- Get `alcotest_stubs.c` to compile with MSVC (mirage/alcotest#369, @jonahbeckford)

- Try automatically reporting the location of calls to Alcotest.check.
  (mirage/alcotest#366, @MisterDA, review by @TheLortex)

- Detect that Alcotest is running in CI and change output accordingly.
  (mirage/alcotest#364, @MisterDA)

- Upgrade to `dune >= 3.0`. (mirage/alcotest#360, @MisterDA)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants