-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
3.8.0: unit-cbor.cpp test failures #2189
Comments
The test suite is now in a separate repository and is downloaded as part of ctest. Can you please try to execute the unit tests as described in https://github.com/nlohmann/json#execute-unit-tests: mkdir build
cd build
cmake .. -DJSON_BuildTests=On
cmake --build .
ctest --output-on-failure |
@nlohmann Thanks for getting back on this so quickly. I see. Hm, I think downloading during build/test is not possible though. Can I download the tarball of the tests myself and extract it to a directory where it will be picked up? |
The code that does the download is here: https://github.com/nlohmann/json/blob/develop/cmake/download_test_data.cmake#L7, so this is possible: mkdir build
cd build
cmake ..
make download_test_data The test files are then downloaded to |
Okay, I can get it to work by downloading the required test data and then:
I think it would be really really awesome to have a cmake option to point at a directory with the test data. For packagers this would be the preferred way, because it allows for properly doing checksums on tarballs for the test data, extract it and run the setup. json/cmake/download_test_data.cmake Lines 7 to 14 in e7452d8
|
Sorry, I do not understand your use case. Why do you want to checksum the test data? Why isn't the current approach sufficient? |
Because this would download assets during build time. On the background: We have a policy (and this is quite similar to that of other distributions which even enforce this by disabling network services in their build infrastructure during build) to not download assets in the build or test steps (and certainly not in the package step of course), as these are files that we can not account for and potentially break a reproducible build. |
I understand. I shall have a look. |
Fedora maintainer here. I cannot use Internet access during official builds. Please add solution to use pre-downloaded test data with Cmake option for example |
@xvitaly Is the approach described in #2189 (comment) feasible for you? |
I will try it now. |
@nlohmann Most of tests passed, but these were failed:
|
@nlohmann Disabled broken tests. Added a temporary workaround to our package. |
@xvitaly Thanks for reporting. Can you provide the output of the failed tests? Which CMake version are you using? |
Would f4c4bab fix your issue? |
It works, but still require Git due to cmake_fetch_content_configure and cmake_fetch_content_build are still broken. |
cmake-3.17.3-1.fc32.x86_64 |
4d96f4c moves the |
Now it builds fine without installed Git. Thanks. But tests cmake_fetch_content_configure and cmake_fetch_content_build are still broken due to missing Git and absent Internet access. New logs:
@nlohmann Just disable these tests if the |
I don't like the implicit dependency between "here is a directory of tests" and "don't execute this specific CMake test". I added a label ctest -LE git_required Please let me know if this is feasible for you. |
The problem is absent Internet access, not Git at all. I can install it in buildroot, but it will not download anything from the Internet. |
I do think the problem is not related to missing Internet access. The
|
@xvitaly Did you test the proposal of #2189 (comment)? |
Yes, it works great. Thank you.
|
@dvzrv Is the approach in #2189 (comment) also working for you? If so, I would merge this. |
@nlohmann I'm using a git clone of this repository, based on a tag which is checked against your PGP signature (but a tarball of the test repository) to build. With that setup I get:
Running the tests against a tarball of this repository I get:
With applying the ctest switch:
Just out of curiosity: What is git used for in that context? Why is it relevant for the tests, if they are already downloaded and in place? |
@dvzrv Good to know! About your question: The test Given that everything works for you, I will merge #2202. |
Hi! I package nlohmann-json for Arch Linux. Upon building version 3.8.0 I ran the unit tests, but some fail.
For the last stable release (3.7.3) I used the below described workflow and the unit tests pass. Maybe something has changed in the meantime?
What is the issue you have?
Full build log:
nlohmann-json-3.8.0-build.log
Please describe the steps to reproduce the issue.
I'm cloning this repository from the commit (as no annotated tags exist) and verify the lightweight tag/commit using the author's PGP signature.
I'm building with:
Additional to the above I run the following to get pkgconfig integration (but that has nothing to do with the tests):
I run tests with:
Note:
When running the test suite using ctest (e.g. as in use in the travis integration)
json/.travis.yml
Lines 324 to 328 in e7452d8
No tests are collected:
Can you provide a small but working code example?
n/a
What is the expected behavior?
All unit-tests pass
And what is the actual behavior instead?
Some
unit-cbor
unit tests fail.Which compiler and operating system are you using?
Which version of the library did you use?
develop
branchIf you experience a compilation error: can you compile and run the unit tests?
see above
The text was updated successfully, but these errors were encountered: