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 743398 - Add support for installed-tests
Add support for installed-tests
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: general
git master
Other All
: Normal enhancement
: Unset
Assigned To: folks-maint
folks-maint
Depends on:
Blocks:
 
 
Reported: 2015-01-23 11:57 UTC by Philip Withnall
Modified: 2015-01-23 14:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: Local change to git.mk to ignore installed-test metadata files (739 bytes, patch)
2015-01-23 13:13 UTC, Philip Withnall
committed Details | Review
tests: Allow pkg-config calls to be overridden by environment variables (3.45 KB, patch)
2015-01-23 13:13 UTC, Philip Withnall
committed Details | Review
tests: Fix load path for a Telepathy test file (1.97 KB, patch)
2015-01-23 13:14 UTC, Philip Withnall
committed Details | Review
tests: Port to use installed-tests (14.10 KB, patch)
2015-01-23 13:14 UTC, Philip Withnall
accepted-commit_now Details | Review
tests: Port to use installed-tests (13.52 KB, patch)
2015-01-23 14:04 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2015-01-23 11:57:48 UTC
Add support for installing the folks unit tests, using:

https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests

This will improve CI by allowing the tests to be re-run whenever a dependency changes; e.g. if EDS changes its behaviour, we can catch that without having to rebuild folks.
Comment 1 Philip Withnall 2015-01-23 13:13:55 UTC
Created attachment 295268 [details] [review]
build: Local change to git.mk to ignore installed-test metadata files

Submitted upstream as: https://github.com/behdad/git.mk/pull/28/.
Comment 2 Philip Withnall 2015-01-23 13:13:58 UTC
Created attachment 295269 [details] [review]
tests: Allow pkg-config calls to be overridden by environment variables

When running installed tests, the pkg-config files for our dependencies
might not be available, so the runtime pkg-config calls will fail and
hence the tests will fail.

Allow overriding the pkg-config calls with environment variables which
will be set in the .test files for the installed tests.
Comment 3 Philip Withnall 2015-01-23 13:14:00 UTC
Created attachment 295270 [details] [review]
tests: Fix load path for a Telepathy test file

The path works fine when running the tests in the source directory, but
not for installed tests. Also, it seems a bit pointless to keep the file
in its own subdirectory; and this will cause problems when installing it
for installed-tests.
Comment 4 Philip Withnall 2015-01-23 13:14:04 UTC
Created attachment 295271 [details] [review]
tests: Port to use installed-tests

Port the unit tests to follow the installed-tests standard, installing
the test binaries and generated .test metadata files.

This removes the existing --enable-tests configure option, replacing it
with the standard:
 • --enable-modular-tests
 • --enable-installed-tests
options. --enable-modular-tests is a direct replacement for
--enable-tests, controlling whether tests are built at compile time, or
only when run under `make check`. --enable-installed-tests controls
whether tests will be installed on the system.

If the tests are installed, use
    gnome-desktop-testing-runner folks
to run them all.
Comment 5 Simon McVittie 2015-01-23 13:43:31 UTC
Review of attachment 295271 [details] [review]:

All patches above here are fine.

This one is OK, but I don't like pre-expanding installation directories at configure time. It's a minor thing - all it breaks is the ability to "make prefix=/opt", but that is technically something that is meant to work in Automake.

::: configure.ac
@@ +574,3 @@
+    ac_expand=`eval echo [$]ac_expand`
+    $3=`eval echo [$]ac_expand`
+])

Is this basically AS_AC_EXPAND? That tends to be a red flag for "you're doing it wrong" - it hard-codes something that is conceptually build-time as it was at configure-time.

@@ +577,3 @@
+
+dnl FULL_LIBEXECDIR is used for X-GNOME-Bugzilla-ExtraInfoScript expansion
+dnl in data/org.gnome.Totem.desktop.in.in.in

Nitpicking: I think you'll find it's used for something other than that :-P

@@ +588,3 @@
+          [Installation path for test binaries])
+AC_DEFINE_UNQUOTED([INSTALLED_TESTS_META_DIR],["$installed_tests_meta_dir"],
+          [Installation path for test metadata (.test files)])

You could replace the AC_DEFINE_UNQUOTED with the CPPFLAGS

    -DINSTALLED_TESTS_DIR=\"${INSTALLED_TESTS_DIR}\"

in the appropriate Makefile(s) (test.mk?) to avoid having to do the expansions.
Comment 6 Simon McVittie 2015-01-23 13:43:53 UTC
Review of attachment 295268 [details] [review]:

.
Comment 7 Simon McVittie 2015-01-23 13:44:24 UTC
Review of attachment 295269 [details] [review]:

looks like changing patch status without a comment crashes Splinter so here is a comment
Comment 8 Simon McVittie 2015-01-23 13:44:30 UTC
Review of attachment 295270 [details] [review]:

yes
Comment 9 Simon McVittie 2015-01-23 13:44:49 UTC
Review of attachment 295271 [details] [review]:

fine to commit tbh
Comment 10 Simon McVittie 2015-01-23 13:45:53 UTC
(In reply to comment #5)
> You could replace the AC_DEFINE_UNQUOTED with the CPPFLAGS
> 
>     -DINSTALLED_TESTS_DIR=\"${INSTALLED_TESTS_DIR}\"
> 
> in the appropriate Makefile(s) (test.mk?) to avoid having to do the expansions.

I'd be fine with you doing this as an additional commit, or saying "no".
Comment 11 Philip Withnall 2015-01-23 14:04:27 UTC
Created attachment 295273 [details] [review]
tests: Port to use installed-tests

Port the unit tests to follow the installed-tests standard, installing
the test binaries and generated .test metadata files.

This removes the existing --enable-tests configure option, replacing it
with the standard:
 • --enable-modular-tests
 • --enable-installed-tests
options. --enable-modular-tests is a direct replacement for
--enable-tests, controlling whether tests are built at compile time, or
only when run under `make check`. --enable-installed-tests controls
whether tests will be installed on the system.

If the tests are installed, use
    gnome-desktop-testing-runner folks
to run them all.
Comment 12 Philip Withnall 2015-01-23 14:07:18 UTC
Pushed with a fix for my braindeadness. Thanks for the review.

Attachment 295268 [details] pushed as 3a95647 - build: Local change to git.mk to ignore installed-test metadata files
Attachment 295269 [details] pushed as 324f868 - tests: Allow pkg-config calls to be overridden by environment variables
Attachment 295270 [details] pushed as 98fe783 - tests: Fix load path for a Telepathy test file
Attachment 295273 [details] pushed as bc77be3 - tests: Port to use installed-tests