Relationship Graph
View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0033374 | mantisbt | other | public | 2023-12-01 17:44 | 2024-02-20 16:58 |
| Reporter | dregad | Assigned To | dregad | ||
| Priority | normal | Severity | minor | Reproducibility | N/A |
| Status | closed | Resolution | fixed | ||
| Product Version | 2.26.0 | ||||
| Target Version | 2.26.1 | Fixed in Version | 2.26.1 | ||
| Summary | 0033374: Erratic behavior of RestProjectVersionTest::testProjectUpdateVersion PHPUnit test case | ||||
| Description | This test case occasionally fails, without any significant change in the code: For example, compare this recent build of master branch which completed successfully:
With the build for PR https://github.com/mantisbt/mantisbt/pull/1942 which just updates a library that is not used in any of the unit tests: | ||||
| Tags | No tags attached. | ||||
|
The assertion to test the version update (PATCH request) is incorrectly setting the timestamp in the updated version data as a Unix timestamp instead of a date string that can be parsed by strtotime(). Depending on the current time, the timestamp is sometimes converted by the strtotime() call in VersionUpdateCommand to a date that is not supported by the database, which causes the SQL UPDATE statement in version_update() to fail. For example: |
|
|
Incorrect logic in test case was introduced by commit MantisBT master 5caafd27 (see 0030415). |
|
|
MantisBT: master 5caafd27 2023-04-22 19:35 Details Diff |
Add test cases for project version APIs + fixes Fixes 0030415 |
Affected Issues 0030415, 0033374 |
|
| mod - api/rest/restcore/projects_rest.php | Diff File | ||
| mod - core/commands/VersionAddCommand.php | Diff File | ||
| mod - core/commands/VersionGetCommand.php | Diff File | ||
| mod - core/commands/VersionUpdateCommand.php | Diff File | ||
| mod - core/version_api.php | Diff File | ||
| mod - manage_proj_ver_add.php | Diff File | ||
| mod - manage_proj_ver_delete.php | Diff File | ||
| mod - tests/core/RequestBuilder.php | Diff File | ||
| mod - tests/rest/RestBase.php | Diff File | ||
| add - tests/rest/RestProjectVersionTests.php | Diff File | ||
|
MantisBT: master-2.26 37930c92 2023-12-01 17:51 Details Diff |
Fix testProjectUpdateVersion() The assertion to test the version update (PATCH request) was incorrectly setting the timestamp in the updated version data as a Unix timestamp instead of a date string to be parsed by strtotime(). Depending on the current time, the timestamp is sometimes converted by the strtotime() call in VersionUpdateCommand to a date that is not supported by the database which causes the SQL UPDATE statement in version_update() to fail. Fixes 0033374 |
Affected Issues 0033374 |
|
| mod - tests/rest/RestProjectVersionTest.php | Diff File | ||
related to
child of
duplicate of