Skip to content

Fix failing tests on x86 systems #1609

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

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Jul 15, 2024

I missed these failures in #1607

These tests specifically test roundtripping 64-bit integers, which are returned as Int64 instances on 32-bit systems only. Since the MongoDB\BSON\Document API always returns Int64 instances, I changed the tests to use the deprecated BSON API as the entire behaviour will be removed in 2.0.

@alcaeus alcaeus self-assigned this Jul 15, 2024

var_dump($test->int64 instanceof MongoDB\BSON\Int64);
var_dump($testRoundtripped->int64 instanceof MongoDB\BSON\Int64);
var_dump(toJSON($bson), toJSON($bsonRoundtripped));
var_dump($json, $jsonRoundtripped);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved up to have all deprecation warnings emitted at the same time, not interlaced with test output.

@@ -8,61 +8,88 @@ MongoDB\BSON\Int64 wraps 64-bit integers on 32-bit platforms
require_once __DIR__ . '/../utils/basic.inc';

$tests = [
MongoDB\BSON\toPHP(MongoDB\BSON\fromJSON('{"max64": {"$numberLong": "9223372036854775807"}}')),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved conversion down to the test itself so that deprecations are emitted for each test separately.

@alcaeus alcaeus marked this pull request as ready for review July 15, 2024 11:24
@alcaeus alcaeus requested a review from GromNaN July 15, 2024 11:24
@alcaeus alcaeus merged commit 7000993 into mongodb:master Jul 15, 2024
72 checks passed
@alcaeus alcaeus deleted the fix-x86-tests branch July 15, 2024 13:06
alcaeus added a commit that referenced this pull request Sep 4, 2024
* master: (22 commits)
  PHPC-2434: Add PHP 8.4 to GitHub Actions (#1625)
  PHPC-2421, PHPC-2428: Update bundled dependencies (#1622)
  Don't build libmongoc version in pull requests
  Use drivers-evergreen-tools for Windows testing (#1615)
  PHPC-1957 Add tests for out-of-range UTCDateTime values (#1614)
  PHPC-2286 Implement `UTCDateTime::toDateTimeImmutable` (#1611)
  PHPC-2414, PHPC-2415: Update wire versions for MongoDB 8.0 compatibility (#1610)
  PHPC-2349, PHPC-2411: Deprecate unused exception classes (#1608)
  Fix failing tests on x86 systems (#1609)
  PHPC-2347: Deprecate BSON functions (#1607)
  PHPC-1489: Deprecate integer readPreference constants (#1604)
  Fix version computation for libmongoc development versions (#1599)
  PHPC-2376: Test against MongoDB 8.0 (#1598)
  PHPC-2254: Relax server selection timeout error message pattern (#1587)
  PHPC-2401: Support QEv2 range protocol (#1583)
  PHPC-2398: Use server_id methods for libmongoc 1.28+ (#1582)
  PHPC-2395: Fetch Atlas connectivity URIs from AWS Secrets Manager (#1579)
  Merge v1.19 into master (#1578)
  Revert "Bump mongodb-labs/drivers-github-tools from 1 to 2 (#1568)" (#1571)
  Bump mongodb-labs/drivers-github-tools from 1 to 2 (#1568)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants