After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777443 - gnome-desktop-testing: output TAP
gnome-desktop-testing: output TAP
Status: RESOLVED OBSOLETE
Product: gnome-continuous
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Continuous maintainer(s)
GNOME Continuous maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-01-18 11:40 UTC by Simon McVittie
Modified: 2021-06-05 16:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Optionally produce TAP output (20.79 KB, patch)
2017-01-18 11:40 UTC, Simon McVittie
none Details | Review
If a test declares that it outputs TAP, print it as a sub-test (2.64 KB, patch)
2017-01-18 11:41 UTC, Simon McVittie
none Details | Review
Sample output: ./gnome-desktop-testing-runner --tap-output dbus (29.16 KB, text/plain)
2017-01-18 11:43 UTC, Simon McVittie
  Details

Description Simon McVittie 2017-01-18 11:40:49 UTC
Created attachment 343709 [details] [review]
Optionally produce TAP output

(Sorry, I couldn't find a Bugzilla component for gnome-desktop-testing, and reasoned that a bug *somewhere* was better than private email.)

https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests suggests that tests should output the machine-readable TAP format, and many do. However, the reference runner for those installed-tests, gnome-desktop-testing, doesn't do the same.

I think it should, so that non-GNOME-specific tools can report which specific sub-tests failed.

If the test also declares that it outputs TAP, we can use the unofficial but widely-supported "subtest" syntax (which Perl's Test::More, one of the major TAP producers, has had since at least 2009). If not, we can escape the output of the sub-test so it isn't interpreted as part of our output, by prepending "#".

The new --tap-output option implies --parallel=1, because screen-scraping output isn't very compatible with concurrency.

(For context for this, there has been mention recently of adding finer-grained test result reporting to Debian's autopkgtest, and I am intending to recommend using TAP for that instead of inventing new wheels. Having GNOME/GLib libraries easily produce TAP from gnome-desktop-testing would be a good way to get finer-grained reporting in many packages at once.)
Comment 1 Simon McVittie 2017-01-18 11:41:28 UTC
Created attachment 343710 [details] [review]
If a test declares that it outputs TAP, print it as a  sub-test

The TAP sub-test syntax is non-standard, but Perl's Test::More
produces it, and https://github.com/tapjs/tap-parser can parse it.
Parsers that do not understand it will treat it as a non-TAP line
to be ignored.
 
(Extensive discussion which unfortunately contains many bike sheds:
<https://github.com/TestAnything/Specification/issues/2>.)
Comment 2 Simon McVittie 2017-01-18 11:43:15 UTC
Created attachment 343711 [details]
Sample output: ./gnome-desktop-testing-runner --tap-output dbus
Comment 3 Simon McVittie 2017-03-06 16:51:15 UTC
It would be more interoperable if this had

----8<----
-# Running test: dbus/test-sd-activation.test
+# Subtest: dbus/test-sd-activation.test
     # random seed: R02S6e6108a40723e788e641ea2b9fd11aee
     1..2
     # Start of sd-activation tests
     # set DBUS_TEST_DATA to a directory containing valid-config-files/systemd-activation.conf
     ok 1 /sd-activation/activation # SKIP DBUS_TEST_DATA not set
     # set DBUS_TEST_DATA to a directory containing valid-config-files/systemd-activation.conf
     ok 2 /sd-activation/uae # SKIP DBUS_TEST_DATA not set
     # End of sd-activation tests
 ok 1 - dbus/test-sd-activation.test
----8<----

which is a popular non-standard syntax for sub-tests.

Alternatively, or even in addition, g-d-t-r could take an argument naming a directory into which to write one .tap file per .test that declares TAP output, without the extra indentation (so each file in that directory is a single valid TAP stream).
Comment 4 Simon McVittie 2017-03-06 16:52:07 UTC
(e.g. http://www.node-tap.org/tap-format/ documents that non-standard syntax)
Comment 5 Philip Withnall 2017-03-06 16:53:10 UTC
(In reply to Simon McVittie from comment #0)
> (Sorry, I couldn't find a Bugzilla component for gnome-desktop-testing, and
> reasoned that a bug *somewhere* was better than private email.)

I think they go under gnome-continuous.
Comment 6 Simon McVittie 2017-12-21 17:48:32 UTC
Bug #788470 has a simpler version, which just diverts tests' stdout to g-d-t's stderr so it doesn't have to be interpreted as TAP. This is not done when using --report-directory or --log-directory, which might be preferable anyway.

Capturing tests' stdout and writing it into the TAP stream, if done, would need to be rebased on what's in Bug #788470.
Comment 7 Philip Withnall 2017-12-21 18:39:24 UTC
CCing Emmanuele since he has somehow avoided getting marked as a maintainer of the gnome-continuous Bugzilla product.
Comment 8 Philip Withnall 2018-11-02 10:56:23 UTC
(In reply to Simon McVittie from comment #6)
> Bug #788470 has a simpler version, which just diverts tests' stdout to
> g-d-t's stderr so it doesn't have to be interpreted as TAP. This is not done
> when using --report-directory or --log-directory, which might be preferable
> anyway.
> 
> Capturing tests' stdout and writing it into the TAP stream, if done, would
> need to be rebased on what's in Bug #788470.

⇒ This needs rebasing, or closing. It probably is valuable to have tests’ output in the aggregate output TAP stream.
Comment 9 Simon McVittie 2018-11-02 13:08:39 UTC
(In reply to Philip Withnall from comment #8)
> ⇒ This needs rebasing, or closing. It probably is valuable to have tests’
> output in the aggregate output TAP stream.

If it'll get reviewed eventually, I'll try to rebase. Is Bugzilla still the preferred route for gnome-desktop-testing contributions?
Comment 10 Philip Withnall 2018-11-02 13:21:21 UTC
I’ll review it. While I’m not a maintainer of g-d-t, I think I can probably wrangle accepting some patches.

g-d-t has had its git migrated to GitLab, but the old issues have not been migrated yet. Despite that, I think anyone who’s likely to review or care about this would prefer an MR on GitLab to patches on Bugzilla. Up to you.

https://gitlab.gnome.org/GNOME/gnome-desktop-testing
Comment 11 André Klapper 2021-06-05 16:29:40 UTC
gnome-continuous is not under active development anymore. Its codebase has been archived: https://gitlab.gnome.org/Archive/gnome-continuous

Closing all its open tickets as part of housekeeping.