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

EXAMPLES_*_TEST require a system installation of gz-math code to work #539

Open
j-rivero opened this issue Jul 20, 2023 · 4 comments · Fixed by gazebosim/gz-cmake#377
Open
Labels
bug Something isn't working

Comments

@j-rivero
Copy link
Contributor

While testing gazebo-release/gz-math7-release#19 I found that gz-math7 nightlies are probably broken after #482. The CI is installing the files into the system before running the test suite (something probably that we should change) so the error has skipped from our CI mechanisms.

Environment

  • OS Version: jammy
  • Source or binary build: source build, gz-math7 branch

Description

  • Expected behavior: testing examples should ideally not require to install the library into the system.
  • Actual behavior: compile the code in the user system and running the test suite makes the EXAMPLES_ test to fail.

Steps to reproduce

  1. checkout current gz-math7 branch
  2. cmake + make
  3. ARGS="-VV -R EXAMPLES*" make test

Output

ign-math/build on  gz-math7 via △ v3.22.1 ❯ ARGS="-VV -R EXAMPLES*" make test
Running tests...
UpdateCTestConfiguration  from :/home/jrivero/code/ignition/ign-math/build/DartConfiguration.tcl
Parse Config file:/home/jrivero/code/ignition/ign-math/build/DartConfiguration.tcl
UpdateCTestConfiguration  from :/home/jrivero/code/ignition/ign-math/build/DartConfiguration.tcl
Parse Config file:/home/jrivero/code/ignition/ign-math/build/DartConfiguration.tcl
Test project /home/jrivero/code/ignition/ign-math/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
    Start 1: EXAMPLES_Configure_TEST

1: Test command: /usr/bin/cmake "-GUnix Makefiles" "--no-warn-unused-cli" "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_C_FLAGS=" "-DCMAKE_CXX_FLAGS=" "-DCMAKE_PREFIX_PATH=/usr/local" "-S" "/home/jrivero/code/ignition/ign-math/examples" "-B" "/home/jrivero/code/ignition/ign-math/build/examples"
1: Test timeout computed to be: 1500
1: CMake Error at CMakeLists.txt:6 (find_package):
1:   By not providing "Findgz-math7.cmake" in CMAKE_MODULE_PATH this project has
1:   asked CMake to find a package configuration file provided by "gz-math7",
1:   but CMake did not find one.
1: 
1:   Could not find a package configuration file provided by "gz-math7" with any
1:   of the following names:
1: 
1:     gz-math7Config.cmake
1:     gz-math7-config.cmake
1: 
1:   Add the installation prefix of "gz-math7" to CMAKE_PREFIX_PATH or set
1:   "gz-math7_DIR" to a directory containing one of the above files.  If
1:   "gz-math7" provides a separate development package or SDK, be sure it has
1:   been installed.
1: 
1: Not searching for unused variables given on the command line.
1: 
1: -- Configuring incomplete, errors occurred!
1: See also "/home/jrivero/code/ignition/ign-math/build/examples/CMakeFiles/CMakeOutput.log".
1/2 Test #1: EXAMPLES_Configure_TEST ..........***Failed    0.01 sec
test 2
    Start 2: EXAMPLES_Build_TEST

2: Test command: /usr/bin/cmake "--build" "/home/jrivero/code/ignition/ign-math/build/examples" "--config" "RelWithDebInfo"
2: Test timeout computed to be: 1500
2: gmake[1]: Entering directory '/home/jrivero/code/ignition/ign-math/build/examples'
2: gmake[1]: Makefile: No such file or directory
2: gmake[1]: *** No rule to make target 'Makefile'.  Stop.
2: gmake[1]: Leaving directory '/home/jrivero/code/ignition/ign-math/build/examples'
2/2 Test #2: EXAMPLES_Build_TEST ..............***Failed    0.00 sec

0% tests passed, 2 tests failed out of 2

Total Test time (real) =   0.02 sec

The following tests FAILED:
	  1 - EXAMPLES_Configure_TEST (Failed)
	  2 - EXAMPLES_Build_TEST (Failed)
Errors while running CTest
Output from these tests are in: /home/jrivero/code/ignition/ign-math/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
make: *** [Makefile:91: test] Error 8
@j-rivero j-rivero added the bug Something isn't working label Jul 20, 2023
@osrf-triage osrf-triage added this to Inbox in Core development Jul 20, 2023
@azeey azeey moved this from Inbox to To do in Core development Jul 24, 2023
@mjcarroll
Copy link
Contributor

Expected behavior: testing examples should ideally not require to install the library into the system.

The way that this was implemented was to not require installation, but instead use the libraries out of the build folder. I will take a look and see what is happening here.

@mjcarroll
Copy link
Contributor

Okay, after taking a look, it's somewhat related to this conversation: gazebosim/gz-cmake#301 (comment)

The issue is that we can't really have a self-contained examples/CMakeLists.txt file without a full installation somewhere. Note that the installation doesn't have to be a system installation, but generally assumes that colcon was the way that the package was built (there was cmake && make && make install before make test). This probably also explains why we didn't catch it in any of our CI before the deb packaging job.

In the past, we had worked around this by making a FAKE_INSTALL target, but this didn't work on Windows for one reason or another.

There may be another work around here, but the crux of the issue is that our gz_find_package logic doesn't work until the package is installed and we require our examples to make use of that flow.

CC: @azeey

j-rivero added a commit to gazebo-release/gz-math7-release that referenced this issue Jul 28, 2023
…ing run (#19)

* Remove obsolete ARM BuildSamples_TEST patch
* Exclude EXAMPLE_ tests for being run until  gazebosim/gz-math#539 is fixed

---------

Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
@azeey
Copy link
Contributor

azeey commented Aug 22, 2023

Not sure if this is ready to be closed yet.

@azeey azeey reopened this Aug 22, 2023
@mjcarroll
Copy link
Contributor

Ah, sorry, github linked issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

3 participants