-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
autotest: run Python tests directly from source tree on Windows #9224
Conversation
ah, this was mostly me not being aware of the -c option of pytest then. But perhaps we could keep the current symlink approach on non-Windows so that only Windows users have to pay the price of using an inferior operating system ;-) ? |
1ca4e57
to
ec5d0c1
Compare
@dbaston do we need to keep that one opened ? I'm trying to reduce the number of staled PRs to keep the list as small as possible. |
I updated this so that the tests are still symlinked on Linux/Mac, so I wasn't planning more work here. It can be merged or closed if we would prefer to continue copying the tests on Windows. |
autotest/CMakeLists.txt
Outdated
if (SKIP_COPYING_AUTOTEST_SUBDIRS) | ||
message(STATUS "Skipping copying ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That can be removed. It only made sense on Windows to sometimes speed-up things to avoid repeated copying of the directories. But here we are in the branch that only symlinks.
ok, sometimes I'm getting lost in what is ready for final review/merge or staled ;-) Don't hesitate to ping me if you see a PR that should be merged Perhaps https://gdal.org/development/testing.html#running-a-subset-of-tests-using-pytest could get some updates to explain the subtelty on Windows of doing "python -m pytest -c autotest/pytest.ini ../autotest/gcore/vrt_read.py" |
ec5d0c1
to
10b4c2a
Compare
10b4c2a
to
8c4b7f2
Compare
Good idea, I've done this at https://github.com/OSGeo/gdal/pull/9224/files#diff-1c899043c9c79440030b3ee7fcf72b357d3333d5070807d933f03ce80b4861edR51 |
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
What does this PR do?
Modifies CMake configuration so that Python tests are run directly from the source tree, rather than from a symlink or copy in the build directory. This is an experiment in removing the following "gotcha":
described in https://lists.osgeo.org/pipermail/gdal-dev/2024-February/058425.html
A downside of this change is that, because
pytest.ini
lives only in the build directory, we must always explicitly provide the config file viapytest -c pytest.ini
. Is it an overall reduction in complexity? I don't know, am interested in feedback.What are related issues/pull requests?
Tasklist