Skip to content

Conversation

@DavidSpickett
Copy link
Collaborator

No description provided.

The CI builds now send the results of every lit run to a unique file.
This means we can read them all to make a combined report for all
tests.

This report will be shown as an "annotation" in the build results:
https://buildkite.com/docs/agent/v3/cli-annotate#creating-an-annotation

Here is an example: https://buildkite.com/llvm-project/github-pull-requests/builds/112546
(make sure it is showing "All" instead of "Failures")

This is an alternative to using the existing Buildkite plugin:
https://github.com/buildkite-plugins/junit-annotate-buildkite-plugin

As the plugin is:
* Specific to Buildkite, and we may move away from Buildkite.
* Requires docker, unless we were to fork it ourselves.
* Does not let you customise the report format unless again,
  we make our own fork.

Annotations use GitHub's flavour of Markdown so the main code in the
script generates that text. There is an extra "style" argument generated
to make the formatting nicer in Buildkite.

"context" is the name of the annotation that will be created. By using
different context names for Linux and Windows results we get 2 separate
annotations.

The script also handles calling the buildkite-agent. This makes passing
extra arguments to the agent easier, rather than piping the output of
this script into the agent.

In the future we can remove the agent part of it and simply use
the report content. Either printed to stdout or as a comment on
the GitHub PR.
@github-actions
Copy link

⚠️ Python code formatter, darker found issues in your code. ⚠️

You can test this locally with the following command:
darker --check --diff -r 9043bdbce4ab1c6f07e72ddfedf7165bdf2b3e40...ffe6c67a2d71ef931dbf4d058f3908b829a5cd87 .ci/fifo_read.py .ci/generate_test_report.py
View the diff from darker here.
--- fifo_read.py	2024-10-25 15:37:37.000000 +0000
+++ fifo_read.py	2024-10-25 15:40:57.771679 +0000
@@ -1,14 +1,14 @@
 import os
 import sys
 import tempfile
 
 if __name__ == "__main__":
-  while True:
-    fifo_path = sys.argv[1]
-    with open(sys.argv[1], 'rb') as fifo:
-      filename, ext = os.path.splitext(os.path.basename(fifo_path))
-      fd, _ = tempfile.mkstemp(
-                suffix=ext, prefix=f"{filename}.", dir=os.path.dirname(fifo_path))
-      with os.fdopen(fd, 'wb') as out:
-        out.write(fifo.read())
-
+    while True:
+        fifo_path = sys.argv[1]
+        with open(sys.argv[1], "rb") as fifo:
+            filename, ext = os.path.splitext(os.path.basename(fifo_path))
+            fd, _ = tempfile.mkstemp(
+                suffix=ext, prefix=f"{filename}.", dir=os.path.dirname(fifo_path)
+            )
+            with os.fdopen(fd, "wb") as out:
+                out.write(fifo.read())

@DavidSpickett
Copy link
Collaborator Author

mkfifo is a dead end, it silently fails to make the fifo when using bash for Windows.

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.

1 participant