Skip to content

tests: Mark the tests that don't need to downoad test files with the … #4669

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

LocutusOfBorg
Copy link
Contributor

This way in Debian and Ubuntu we can easily skip them when no internet is available

@coveralls
Copy link

coveralls commented Feb 27, 2025

Coverage Status

coverage: 99.186%. remained the same
when pulling eedb7a8 on LocutusOfBorg:offline-tests
into 8215dba on nlohmann:develop.

…offline label

Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
@gregmarr
Copy link
Contributor

Is it better to mark the ones that don't need to download things, or the ones that do?

@nlohmann
Copy link
Owner

nlohmann commented Apr 4, 2025

From the README:

Note that during the ctest stage, several JSON test files are downloaded from an external repository. If policies forbid downloading artifacts during testing, you can download the files yourself and pass the directory with the test files via -DJSON_TestDataDirectory=path to CMake. Then, no Internet connectivity is required. See issue #2189 for more information.

Would using JSON_TestDataDirectory be an option?

Copy link

github-actions bot commented May 5, 2025

This pull request has been marked as stale because it has had no activity for 30 days. While we won’t close it automatically, we encourage you to update or comment if it is still relevant. Keeping pull requests active and up-to-date helps us review and merge changes more efficiently. Thank you for your contributions!

@github-actions github-actions bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label May 5, 2025
@LocutusOfBorg
Copy link
Contributor Author

Can we merge and improve later maybe?

@nlohmann
Copy link
Owner

nlohmann commented May 7, 2025

Can you check if JSON_TestDataDirectory works for you?

@github-actions github-actions bot removed the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label May 8, 2025
@LocutusOfBorg
Copy link
Contributor Author

Hello, so some questions:

  1. why is this test data on different repo?
    (I presume due to $SIZE)
  2. adding it as external tarball will increase the code complexity, forget to update, make source download heavier, as well as having it as git submodule.
    I'll think a little bit about it, but maybe instead of having a 100MB tarball additional, we can better exclude some tests...

@LocutusOfBorg
Copy link
Contributor Author

ok we can package the json test data separately in Debian as standalone project, this will also help your ci test environment (if you want to use apt)
Something like this looks working, but I now have errors in cmake_fetch and fetch2 tests (we need to disable them too)

--- nlohmann-json3-3.11.3.orig/cmake/download_test_data.cmake
+++ nlohmann-json3-3.11.3/cmake/download_test_data.cmake
@@ -1,6 +1,12 @@
 set(JSON_TEST_DATA_URL     https://github.com/nlohmann/json_test_data)
 set(JSON_TEST_DATA_VERSION 3.1.0)
 
+set(JSON_TEST_DATA_DIR /usr/share/json_test_data-${JSON_TEST_DATA_VERSION})
+
+if(EXISTS ${JSON_TEST_DATA_DIR})
+  set(JSON_TestDataDirectory ${JSON_TEST_DATA_DIR})
+endif()
+
 # if variable is set, use test data from given directory rather than downloading them
 if(JSON_TestDataDirectory)
     message(STATUS "Using test data in ${JSON_TestDataDirectory}.")

@LocutusOfBorg
Copy link
Contributor Author

 88 - cmake_fetch_content_configure (Failed)            git_required not_reproducible
 89 - cmake_fetch_content_build (Not Run)               git_required not_reproducible
 90 - cmake_fetch_content2_configure (Failed)           git_required not_reproducible
 91 - cmake_fetch_content2_build (Not Run)              git_required not_reproducible

@nlohmann
Copy link
Owner

nlohmann commented May 8, 2025

  1. why is this test data on different repo?
    (I presume due to $SIZE)

Exactly.

Copy link

github-actions bot commented Jun 8, 2025

This pull request has been marked as stale because it has had no activity for 30 days. While we won’t close it automatically, we encourage you to update or comment if it is still relevant. Keeping pull requests active and up-to-date helps us review and merge changes more efficiently. Thank you for your contributions!

@github-actions github-actions bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake M state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants