-
Notifications
You must be signed in to change notification settings - Fork 264
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
PHPLIB-1541: Include specs repository as a submodule #1429
Changes from all commits
73a17d1
b603979
d1313e9
135582a
99c7d24
6244176
7eb4d70
c5c0631
70a38d9
fb7b3ec
b0269f6
b1b1260
5615fc5
1ed6e95
65357f4
d9fc698
af04a9c
afbcd0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "specifications"] | ||
path = tests/specifications | ||
url = https://github.com/mongodb/specifications |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,8 @@ class Prose22_RangeExplicitEncryptionTest extends FunctionalTestCase | |
private ?Client $encryptedClient = null; | ||
private $key1Id; | ||
|
||
private static string $specDir = __DIR__ . '/../../specifications/source/client-side-encryption'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason not to use a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No real reason other than using I suppose we could change this property, as well as a number of other properties in UnifiedSpecTest private constants. |
||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
@@ -50,7 +52,7 @@ public function setUp(): void | |
|
||
$client = static::createTestClient(); | ||
|
||
$key1Document = $this->decodeJson(file_get_contents(__DIR__ . '/../client-side-encryption/etc/data/keys/key1-document.json')); | ||
$key1Document = $this->decodeJson(file_get_contents(self::$specDir . '/etc/data/keys/key1-document.json')); | ||
$this->key1Id = $key1Document->_id; | ||
|
||
// Drop the key vault collection and insert key1Document with a majority write concern | ||
|
@@ -85,7 +87,7 @@ public function setUpWithTypeAndRangeOpts(string $type, array $rangeOpts): void | |
* for 64-bit integers. This means that DropEncryptedCollection and | ||
* CreateEncryptedCollection will be unable to inspect the option for | ||
* metadata collection names, but that's not necessary for the test. */ | ||
$encryptedFields = Document::fromJSON(file_get_contents(__DIR__ . '/../client-side-encryption/etc/data/range-encryptedFields-' . $type . '.json')); | ||
$encryptedFields = Document::fromJSON(file_get_contents(self::$specDir . '/etc/data/range-encryptedFields-' . $type . '.json')); | ||
|
||
$database = $this->encryptedClient->selectDatabase($this->getDatabaseName()); | ||
$database->dropCollection('explicit_encryption', ['encryptedFields' => $encryptedFields]); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmikola this is a first shot at covering potential failures in a dependabot PR. Let me know if I missed something or if we should change the guidance. Either way, this would be a learning experience from us and might require some care when implementing spec changes (e.g. don't modify existing test cases when adding functionality).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The three bullets above seem sufficient.
I'm not sure what you mean by "don't modify existing test cases when adding functionality". I assume you're not talking about making custom modifications to the JSON files, as I've never done that (although I recall libmongoc has).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm referring to when changes are made in the specs repository. For example, new functionality should rely on new tests as much as possible, without changing existing tests. This allows skipping new tests without sacrificing code coverage because we'd have to skip a test that we were previously able to run.