Skip to content

Conversation

@kmahar
Copy link
Contributor

@kmahar kmahar commented May 21, 2019

as of SERVER-10075 server will error if you create an index using expireAfterSeconds on more than one key. we had a test that was just trying all the index options at once and creating a multi-key index so it started failing on MacOS which I guess bumped latest in the last few days.

in this PR I:

  • moved all the index tests to a new file
  • test expireAfterSeconds separately from the other options
  • made the test into more of an integration test by calling listIndexes and decoding the results into IndexOptions that can be compared against the original options

evg patch confirming this fixes it here

* - Example: For an index of name: 1, age: -1, the generated name would be "name_1_age_-1".
*/
public let name: String?
public var name: String?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this and indexVersion became mutable for the sake of the test. I considered updating all of them but I think that ticket will make it into our next release anyway

expect(indexes.next()).to(beNil())
}

func testIndexOptions() throws {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the only index test that actually changed.

}
}

extension IndexOptions: Equatable {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is new too.

@kmahar kmahar requested review from mbroadst and patrickfreed May 21, 2019 22:20
@kmahar kmahar merged commit ebc1e15 into master May 23, 2019
@kmahar kmahar deleted the index-test branch May 23, 2019 18:20
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.

4 participants