-
Notifications
You must be signed in to change notification settings - Fork 1.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
unique nids in revisions.yml #8865
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8865 +/- ##
=======================================
Coverage ? 82.38%
=======================================
Files ? 98
Lines ? 5870
Branches ? 0
=======================================
Hits ? 4836
Misses ? 1034
Partials ? 0 |
OK, so now we probably have to create nodes for nid 39-51, based on copies of the most minimal version of this possible: plots2/test/fixtures/nodes.yml Lines 1 to 11 in 5b387b6
|
@jywarren Would it still help to have someone work on this? I'm not sure how urgent this is now that we've switched CI over from Travis... Catching up on this thread just now. I can probably give this a shot if it makes sense for me to do it (since I'm working with fixtures and adding a bunch of new ones). I'm thinking I would do something like below:
Let me know if there's anything else good to know! |
Just played around with this, pushed some commits. There's still some new failing tests to figure out, so more work should be done on this. I think it makes sense to add new nodes to match the new revisions, if we're going to go this route... I ran the tests on both scenarios, and it seems easier to untangle if there are new nodes matching the revisions. Honestly, this might be a red herring-- I still basically get the same 7 failures, 12 errors running the tests. So I'm not sure if the fix will solve any of those outstanding testing issues. |
Currently test-runner is catching four errors in plots2/test/functional/notes_controller_test.rb Lines 657 to 664 in 9c409ec
I think what's going on is that get :index is only pulling the first 20 notes due to pagination, maybe? That's why
Any ideas or suggestions? EDIT: Here are the notes that plots2/app/controllers/home_controller.rb Lines 79 to 87 in 9c409ec
They're sorted in descending order by nid, so a note with nid:1 would appear toward the end of the array. Will pagination even affect the results that are in @notes? |
I would love help, to be honest, i didn't manage to get to this today! Pls note that we seem to be pretty far from synced with the The failure mode here, which may help with your Qs, is that different databases and environments can /order/ fetched records differently, especially if they have the same That said, this may not solve other issues, not sure -- but it hopefully will reduce the incidence of some tests passing in one environment but failing in another due to subtle differences in how databases sort un-sortable data (i.e. how they handle a bunch of records with identical fields). Hope this makes sense -- thank you!!!! |
OK, this will take a lot of work. But we should also try to incorporate a plots2/app/views/home/home.html.erb Line 2 in 2c68070
|
This needs a rebase! But also, let's add comments at the bottom of nodes.yml, revisions.yml, and other relevant files that clearly explain how we need unique nids. |
a883f9e
to
a291fe0
Compare
Ugh, the commit history for this PR was awful before! Sorry, that was my bad, it was an attempt gone wrong at But I just did another Let's see how the tests do. There were four merge conflicts that were a little funny that I undid manually. But I'm sure the tests will be more revealing if I did the merge conflicts wrong. If I recall correctly, this can't be merged as is. There's a system test that was failing that I mentioned above here, that I believed at the time had to do with results pagination on |
Gotcha, let me see if i can get past that pagination one. Should be pretty easy. |
Also noting the functional test failures were:
|
OK let's just rewrite those 4 to actually assert exactly what they say - that in the first one, all results are status == 1, for example. That should solve it and the current assertions aren't very good anyways! |
plots2/test/functional/notes_controller_test.rb Lines 665 to 704 in a291fe0
|
OK, narrowed the test assertions a bit. Let's see. There may be other issues. |
We may need to push the "first-time-poster" node to the end so it shows up. But, maybe we are OK with it not appearing on the |
OK, so the functional test could be fixed by #9321 -- let's rebase over.
System tests...
I bet it's a reordering issue related to the nids. Let's check... |
plots2/test/system/dashboard_test.rb Lines 26 to 36 in 04f5093
|
I bet that's pagination. Let's adjust that so it uses the last node. |
52568ed
to
2eeb57a
Compare
Rebased over the fix... |
ALMOSTTTTTT |
Code Climate has analyzed commit 16c21ed and detected 0 issues on this pull request. View more on Code Climate. |
Even after these NID fixes, this still went wrong:
I wonder if that's a different issue, non-NID? We can follow up in a new issue. https://github.com/publiclab/plots2/pull/8865/checks?check_run_id=2126281351 |
Yes, the tag test seems totally unrelated: plots2/test/unit/tag_selection_test.rb Lines 5 to 16 in d70efef
|
* unique nids in revisions.yml * change user 1 -> 2, add timestamp, status publiclab#8864 * add nodes matching new revision fixtures publiclab#8864 * update assertions for all notes to match new fixtures publiclab#8864 * switch to assert assigns(:notes).collect(&:status).uniq == [1] * adjust node order in test * Update notes_controller_test.rb Co-authored-by: Will Gutierrez <[email protected]>
* unique nids in revisions.yml * change user 1 -> 2, add timestamp, status publiclab#8864 * add nodes matching new revision fixtures publiclab#8864 * update assertions for all notes to match new fixtures publiclab#8864 * switch to assert assigns(:notes).collect(&:status).uniq == [1] * adjust node order in test * Update notes_controller_test.rb Co-authored-by: Will Gutierrez <[email protected]>
fixes #8864 i hope!