[Bug 40169] New: Cypress tests - mockData should not replace "_id" fields if passed
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Bug ID: 40169 Summary: Cypress tests - mockData should not replace "_id" fields if passed Change sponsored?: --- Product: Koha Version: 24.11 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: jonathan.druart@gmail.com QA Contact: testopia@bugs.koha-community.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|chris@bigballofwax.co.nz |jonathan.druart@gmail.com Version|24.11 |unspecified Depends on| |38503 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38503 [Bug 38503] Add a Cypress task to generate objects based on its swagger def spec -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 183350 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183350&action=edit Bug 40169: Add a test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 183351 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183351&action=edit Bug 40169: mockData - Do not replace _id if passed If we build an object and pass a primary key (ie. suffixed by _id) we should not replace it. Test plan: The test highlights the problem, it won't affect existing tests. 0. Apply only the first patch (Cypress tests) 1. Run yarn cypress run t/cypress/integration/t/mockData.ts => It fails 2. Apply this patch => It passes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- I had failed tests before and after the patches were applied: 1. Failed tests before the patches were applied: - ERM/DataProviders_spec.ts - ERM/UsageReports_spec.ts 2. Failed tests with both the patches applied: - ERM/DataProviders_spec.ts - ERM/UsageReports_spec.ts - KohaTable/Holdings_spec.ts -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to David Nind from comment #3)
I had failed tests before and after the patches were applied:
1. Failed tests before the patches were applied: - ERM/DataProviders_spec.ts - ERM/UsageReports_spec.ts
2. Failed tests with both the patches applied: - ERM/DataProviders_spec.ts - ERM/UsageReports_spec.ts - KohaTable/Holdings_spec.ts
Can you try again after a reset_all please? They all pass for me. If still failing, could you paste the output? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #4)
(In reply to David Nind from comment #3)
I had failed tests before and after the patches were applied:
1. Failed tests before the patches were applied: - ERM/DataProviders_spec.ts - ERM/UsageReports_spec.ts
2. Failed tests with both the patches applied: - ERM/DataProviders_spec.ts - ERM/UsageReports_spec.ts - KohaTable/Holdings_spec.ts
Can you try again after a reset_all please? They all pass for me.
If still failing, could you paste the output?
Hum, the 2 ERM tests are indeed failing on main, and with this patch (so not related). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183350|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 183378 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183378&action=edit Bug 40169: Add a test Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183351|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 183379 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183379&action=edit Bug 40169: mockData - Do not replace _id if passed If we build an object and pass a primary key (ie. suffixed by _id) we should not replace it. Test plan: The test highlights the problem, it won't affect existing tests. 0. Apply only the first patch (Cypress tests) 1. Run yarn cypress run t/cypress/integration/t/mockData.ts => It fails 2. Apply this patch => It passes Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 --- Comment #8 from David Nind <david@davidnind.com> --- The tests (excluding the ERM ones) now pass. Doing a reset_all seems to have done the trick. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183379|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 183925 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183925&action=edit Bug 40169: mockData - Do not replace _id if passed If we build an object and pass a primary key (ie. suffixed by _id) we should not replace it. Test plan: The test highlights the problem, it won't affect existing tests. 0. Apply only the first patch (Cypress tests) 1. Run yarn cypress run t/cypress/integration/t/mockData.ts => It fails 2. Apply this patch => It passes Signed-off-by: David Nind <david@davidnind.com> Amended-by: Jonathan Druart Remove .only -- You are receiving this mail because: You are watching all task changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183378|0 |1 is obsolete| | --- Comment #10 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 183926 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183926&action=edit Bug 40169: Add a test Signed-off-by: David Nind <david@davidnind.com> Amended by: Jonathan Druart Remove .only -- You are receiving this mail because: You are watching all task changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183925|0 |1 is obsolete| | --- Comment #11 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 183927 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=183927&action=edit Bug 40169: mockData - Do not replace _id if passed If we build an object and pass a primary key (ie. suffixed by _id) we should not replace it. Test plan: The test highlights the problem, it won't affect existing tests. 0. Apply only the first patch (Cypress tests) 1. Run yarn cypress run t/cypress/integration/t/mockData.ts => It fails 2. Apply this patch => It passes Signed-off-by: David Nind <david@davidnind.com> Amended-by: Jonathan Druart Remove .only -- You are receiving this mail because: You are watching all task changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |40174 Referenced Tasks: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40174 [Task 40174] Add a way to cleanly insert data in DB from Cypress tests -- You are receiving this mail because: You are watching all task changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183926|0 |1 is obsolete| | --- Comment #12 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 184092 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184092&action=edit Bug 40169: Add a test Signed-off-by: David Nind <david@davidnind.com> Amended by: Jonathan Druart Remove .only -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #183927|0 |1 is obsolete| | --- Comment #13 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 184093 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184093&action=edit Bug 40169: mockData - Do not replace _id if passed If we build an object and pass a primary key (ie. suffixed by _id) we should not replace it. Test plan: The test highlights the problem, it won't affect existing tests. 0. Apply only the first patch (Cypress tests) 1. Run yarn cypress run t/cypress/integration/t/mockData.ts => It fails 2. Apply this patch => It passes Signed-off-by: David Nind <david@davidnind.com> Amended-by: Jonathan Druart Remove .only -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184092|0 |1 is obsolete| | --- Comment #14 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 184096 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184096&action=edit Bug 40169: Add a test Signed-off-by: David Nind <david@davidnind.com> Amended by: Jonathan Druart Remove .only Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184093|0 |1 is obsolete| | --- Comment #15 from Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> --- Created attachment 184097 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184097&action=edit Bug 40169: mockData - Do not replace _id if passed If we build an object and pass a primary key (ie. suffixed by _id) we should not replace it. Test plan: The test highlights the problem, it won't affect existing tests. 0. Apply only the first patch (Cypress tests) 1. Run yarn cypress run t/cypress/integration/t/mockData.ts => It fails 2. Apply this patch => It passes Signed-off-by: David Nind <david@davidnind.com> Amended-by: Jonathan Druart Remove .only Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matt.blenkinsop@openfifth.c | |o.uk Status|Signed Off |Passed QA QA Contact|testopia@bugs.koha-communit |matt.blenkinsop@openfifth.c |y.org |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |25.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 --- Comment #16 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|25.11.00 |25.11.00,25.05.02 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 --- Comment #17 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 25.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Version(s)|25.11.00,25.05.02 |25.11.00,25.05.02,24.11.08 released in| | Status|Pushed to stable |Pushed to oldstable --- Comment #18 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 24.11.x for 24.11.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Bug 40169 depends on bug 38503, which changed state. Bug 38503 Summary: Add a Cypress task to generate objects based on its swagger def spec https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38503 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting --- Comment #19 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40169 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #20 from David Nind <david@davidnind.com> --- Test suite related, no changes to manual required. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org