CI: run the tests and a smoke test on every PR - #239
Open
joelhaasnoot wants to merge 2 commits into
Open
Conversation
joelhaasnoot
force-pushed
the
ci/github-actions
branch
from
August 4, 2026 20:08
722b72b to
c185035
Compare
joelhaasnoot
force-pushed
the
ci/github-actions
branch
from
August 5, 2026 06:55
c185035 to
f7751b4
Compare
joelhaasnoot
force-pushed
the
ci/github-actions
branch
from
August 5, 2026 11:48
f7751b4 to
efcd927
Compare
joelhaasnoot
force-pushed
the
ci/github-actions
branch
from
August 5, 2026 11:48
efcd927 to
f476b43
Compare
The suite has not run in a while. Test discovery itself was broken: openebs/tests and kv1/tests imported their modules by hand through loader.find_module(), which Python 3.12 removed, so nothing ran at all. Django discovers test*.py by itself, so the initialisers can be empty. With discovery working, 24 of 36 tests failed. Most were stale fixtures, but five were real bugs the tests had been unable to report: - Kv15Scenario.delete_all() filtered on messageendtime__gt=now, passing the function instead of calling it, so deleting a planned scenario raised TypeError - sendkv6 compared msg.delay > 0 on a nullable field in two of the three places it checks it, so a ferry message without a delay crashed the command. The init branch already guarded for None - get_pushers() raised ImproperlyConfigured when any subscriber lacked the message type, and ndovloket_rig has no KV6 endpoint - so KV6 could not even be imported. Skip subscribers that do not take the type - the KV17 journey template read "mutation > 0 or shorten > 0 and not is_recovered", and "and" binds tighter than "or", so a recover still emitted a mutation message block - verify_messages matched KV8 deletes with get_or_create() on the KV8 identity, but an updated message leaves the superseded version behind carrying that same identity, so the lookup raised MultipleObjectsReturned. Match the most recent one The rest is fixture rot: stops are matched by QuayCode rather than timingpointcode, message identity moved to OriginalMessageCode*, mutation messages moved to their own model, KV17 cancels gained showcancelledtrip and autorecover, import_rid reads bison_id, and assertEquals is gone in Python 3.12. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Runs against a postgis service container: one job for the test suite, one that migrates, imports a small RID fixture, boots the server and checks the main pages load for a logged-in user - including that the map still carries its search box. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
joelhaasnoot
force-pushed
the
ci/github-actions
branch
from
August 5, 2026 13:22
f476b43 to
c46ca35
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
.github/workflows/ci.yml, running on every pull request and on pushes to master. Both jobs run against apostgis/postgis:17-3.5service container.Tests — installs the GeoDjango system libraries, writes a
local_settings.pypointing at the service container, runsmanage.py test.Smoke test — migrates, imports a two-line/two-stop RID fixture, boots the server, then logs in and checks the pages actually come back:
/bericht,/bericht/nieuw,/kaart,/haltes.geojson,/stop/search.json,/scenario,/ritaanpassing,/admin/. Content assertions where they are cheap — the map page must still containautocomplete_holder(the search box from #234), the geojson must be aFeatureCollection, and the stop search must return the imported stop.Verified by running
.github/scripts/smoke.pyagainst a real local server: all ten checks pass.Test discovery was broken
openebs/tests/__init__.pyandkv1/tests/__init__.pyimported their test modules by hand vialoader.find_module(...).load_module(...). Python 3.12 removedfind_module, so the whole suite died at import withAttributeError: 'FileFinder' object has no attribute 'find_module'— zero tests ran. Django has discoveredtest*.pyon its own since 1.6, so emptying the initialisers is enough.The suite is currently red
With discovery fixed, 36 tests run and 24 fail. All of it predates this PR and none of it is touched here:
test_command_verify—KeyError: 'QuayCode'/'OriginalMessageCodeDate'. The rows the tests hand toprocess_messagelack fieldsverify_messages.pynow reads (lines 75, 139, 142).showcancelledtrip/autorecover(Features showcancelled & autorecover #214).ferry.tests.test_kv6_auto—ImproperlyConfigured: Endpoint type isn't registered, raised at import fromutils/views.py:89.So the Tests job will be red until those are dealt with. I left it blocking rather than papering over it — happy to file an issue, or fix them in a follow-up PR if you want to say what the expected behaviour should be.
Stacking
Based on
fix/social-login-flag(#238) and contains #237, both of which it needs: without #237pip install -r requirements.txtfails, and without #238/inloggen/500s in CI with noSocialApprow. Once those merge this collapses to just the CI files. Merge #237 and #238 first.🤖 Generated with Claude Code