[FOLIO-2369] Issue with BigTest tests Created: 28/Nov/19 Updated: 03/Jun/20 Resolved: 28/Nov/19 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Bug | Priority: | TBD |
| Reporter: | Viktor Soroka | Assignee: | Viktor Soroka |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Issue links: |
|
||||||||
| Sprint: | Concorde - Sprint 77 | ||||||||
| Story Points: | 1 | ||||||||
| Development Team: | Concorde | ||||||||
| Description |
|
Translations issue prevents from running bigtest. Example of failing tests report. |
| Comments |
| Comment by Viktor Soroka [ 28/Nov/19 ] |
|
The PR I created handles the issue only in stripes-core. It seems like after the merge other modules still struggle the same issue. In order to overcome it, add the following to the package.json of the needed project if it is not presented there yet. "resolutions": { "fake-xml-http-request": "2.0.0" }, Additionally, created the issue in PretenderJs project about the root cause of the issue. |
| Comment by Zak Burke [ 03/Dec/19 ] |
|
Can you explain what this translations issue actually is? The two PRs attached to this ticket only state that they "Handle the issue with tests upon the loading of translations", and the link to Jenkins in the description does not actually point to a log, but Jenkins recycles old builds pretty quickly regardless and it would be nice to have a description of the problem some place permanent. |
| Comment by Michal Kuklis [ 03/Dec/19 ] |
|
I didn't realize we had a ticket for this but here is a short description (Viktor Soroka please feel free to comment on this too). Viktor Soroka discovered a bug in one of the libraries (FakeXMLHttpRequest) used by the BigTest: https://github.com/pretenderjs/FakeXMLHttpRequest/issues/54 introduced by this PR: https://github.com/pretenderjs/FakeXMLHttpRequest/pull/53 The PR introduced a new property called response which was not present before. This property is used by a fetch library which checks if the response is present on the xhr object in order to return the response body: https://github.com/github/fetch/blob/master/fetch.js#L462 Since the response is set to null in some situations by FakeXMLHttpRequest all xhr requests including JSON requests for translation files started to fail. In order to fix it we decided to patch the FakeXMLHttpRequest to bring it back to version 2.0.1: https://github.com/folio-org/stripes-core/pull/761 As Zak Burke mentioned in: https://github.com/pretenderjs/pretender/issues/283 This all could have been avoided if the FakeXMLHttpRequest was versioned correctly (with a major release) or if the pretender lib (which depends on FakeXMLHttpRequest) changed the dependency on fake-xml-http-request from ^2.0.0 to ~2.0.0 |
| Comment by Zak Burke [ 13/Dec/19 ] |
|
Update: PretenderJS finally released a new patch release in the old v2 line, v2.1.2, that restricts the dependency on fake-xml-http-request from ^2.0 to ~2.0 in order to avoid pulling in the breaking changes they inadvertently introduced in v2.1.1. What now? I think we can revert https://github.com/folio-org/stripes-core/pull/761 but we need to do some testing first. |