Skip to content

Basic CI integration - #364

Merged
samoht merged 3 commits into
mirage:mainfrom
MisterDA:ci-integration
Nov 18, 2022
Merged

samoht merged 3 commits into
mirage:mainfrom
MisterDA:ci-integration

Conversation

@MisterDA

Copy link
Copy Markdown
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.

Comment thread src/alcotest-engine/config_intf.ml Resolved
@samoht

samoht commented Nov 17, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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

samoht commented Nov 18, 2022

Copy link
Copy Markdown
Member

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)
This was referenced Nov 2, 2026
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.

2 participants