-
-
Notifications
You must be signed in to change notification settings - Fork 357
tests: Run gunittest-based tests with pytest that don’t require gunittest #5584
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
Conversation
…d note which tests run successfully
CI(pytest): Remove commented out ci args
…or running gunittest-based tests with pytest
4c4efbc
to
11a7f5b
Compare
@wenzeslaus If you have the chance, can you take a look before the weekend, so I can continue off of it after? |
There's a new error since I merged main that I didn't saw yet before. |
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.
I don't have time to re-review this in depth right now, but I already looked at it earlier and didn't see any red flags then and I don't see them now.
I'll have to find what changed in the last 8 days or so that make the collection fail now.. The cause is not what I was expecting, so I'll need to dig deeper, and will need a new approval then. |
Ok, I've taken a look. It is not a problem from the commits we did since: trying different revisions end up failing too, and even re-running a passing job from 2 weeks ago (April 23 2025), now fails. I compared an old copy of the grass85 OSGeo4W install folder I had from March 8, 2025, and I indeed see that some functions are not in the python/grass/lib/raster.py file anymore: Looking at a rerun of a previously passing job, I now see in the compilation logs the following, that explains why the function isn't there:
Since gunittest on Windows doesn't enforce 100% success in CI, it got unnoticed, as the success (file-wise) was 96.3 and the threshold was 96. So what changed that made the new errors appear in the compilation process to create the ctypes bindings? |
The first appearance of the error in our CI logs was in a PR run on April 27, 2025, https://github.com/OSGeo/grass/actions/runs/14692952416/job/41230768339#step:7:3522
|
A nice hint is given in the page "Porting to GCC 15", section "New keywords"
So, as announced, GCC15 defaults to C23. Seems we don't work correctly now, and maybe rebuilds of grass84 on OSGeo4W could be broken if it doesn't keep the old default. For grass 8.5, we've had some work done to fix many issues, but we forgot that part it seems. @nilason Do you have ideas where to start to find a fix for compiling correctly with GCC15? In the meantime, setting -std=c17 or -std=gnu17 might get it back to work. |
There's also the top of this article that mentions something interesting: "ell |
See also #5585 for |
Let's see if #5618 was enough. I hope so. |
Unfortunately, #5618 wasn't enough, the ctypes binding still don't emit |
If we would be able to have our builds working with Ubuntu 24.04, I had work started to be able to run the equivalent of the gcc17 standard check job, but with newer compiler versions. But, some packages are missing (at least 2). For example, since pdal isn't in the package repository anymore, the current package list fails. I would expect to see some of the gcc15 issues there, if it is caused only by gcc15, and not ctypesgen, that would need to be updated here from upstream, and upstream is not really active. |
Update this PR again after #5621 is merged. Remove the contents added in the last commit. Keeping it running to show it works |
Ready to merge :) |
Some tests are being run by gunittest, which doesn’t bring much value over pytest. Some of them don’t even require features brought by gunittest, and don’t require too much special grass setup to run.
Thus, this PR starts the work of making pytest run some of the tests in testsuite directories. This first subset are only the ones that have all of their tests passing, on all three platforms.
--deselect
in a list. I just couldn’t find the way to not have the Python interpreter just crash when calling a grass C-library functions through ctypes (like G_mapset_path(), or any setup-like functions). Since it isn’t run through a grass --exec, there’s a difference.