Description
Jonathan Druart
2025-06-18 20:18:27 UTC
Created attachment 183350 [details] [review] Bug 40169: Add a test Created attachment 183351 [details] [review] 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 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 (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? (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). Created attachment 183378 [details] [review] Bug 40169: Add a test Signed-off-by: David Nind <david@davidnind.com> Created attachment 183379 [details] [review] 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> The tests (excluding the ERM ones) now pass. Doing a reset_all seems to have done the trick. Created attachment 183925 [details] [review] 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 Created attachment 183926 [details] [review] Bug 40169: Add a test Signed-off-by: David Nind <david@davidnind.com> Amended by: Jonathan Druart Remove .only Created attachment 183927 [details] [review] 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 Created attachment 184092 [details] [review] Bug 40169: Add a test Signed-off-by: David Nind <david@davidnind.com> Amended by: Jonathan Druart Remove .only Created attachment 184093 [details] [review] 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 Created attachment 184096 [details] [review] 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> Created attachment 184097 [details] [review] 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> Nice work everyone! Pushed to main for 25.11 Nice work everyone! Pushed to 25.05.x Pushed to 24.11.x for 24.11.08 |