Skip to content

Adding validation tests for LazyMapCollection #2330

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
Apr 29, 2016

Conversation

austinzheng
Copy link
Contributor

What's in this pull request?

Redoing #2247. Tests have been rebased onto latest master, and Dmitri's patch has been applied to make them compile. @gribozavr

Adding pseudorandom data for the filter tests will be a follow-up PR.


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

@gribozavr
Copy link
Contributor

@swift-ci Please test

@austinzheng
Copy link
Contributor Author

@gribozavr Note that while everything compiled and ran, there are still test failures. Not sure if that's expected or not, just wanted you to be aware.

Let me know if you want additional changes.

@gribozavr
Copy link
Contributor

@austinzheng I see. We can't merge if there are test failures -- we'd need to investigate.

@austinzheng
Copy link
Contributor Author

@gribozavr The tests that fail are:

"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<OpaqueValue<Int>>>.Type.dropLast/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<OpaqueValue<Int>>>.Type.dropLast/semantics/equivalence", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<OpaqueValue<Int>>>.Type.suffix/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<OpaqueValue<Int>>>.Type.suffix/semantics/equivalence", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<OpaqueValue<Int>>>.Type.dropLast/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<OpaqueValue<Int>>>.Type.suffix/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<OpaqueValue<Int>>>.Type.last", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<OpaqueValue<Int>>>.Type.removeLast()/slice/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<OpaqueValue<Int>>>.Type.removeLast(n: Int)/slice/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<OpaqueValue<Int>>>.Type.popLast()/slice/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<OpaqueValue<Int>>>.Type.dropLast/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<OpaqueValue<Int>>>.Type.suffix/semantics",
"LazyFilterCollection<MinimalCollection<LifetimeTracked>>.Type.index(where:)/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.dropLast/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.dropLast/semantics/equivalence", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.suffix/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.suffix/semantics/equivalence", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.index(where:)/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.dropLast/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.suffix/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.last", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.removeLast()/slice/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.removeLast(n: Int)/slice/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.popLast()/slice/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.dropLast/semantics", 
"LazyFilterBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>>.Type.suffix/semantics", 
"LazyFilterCollection instances"

and

"LazyMapCollection<MinimalCollection<LifetimeTracked>, LifetimeTracked>.Type.index(where:)/semantics", 
"LazyMapBidirectionalCollection<MinimalBidirectionalCollection<LifetimeTracked>, LifetimeTracked>.Type.index(where:)/semantics", 
"LazyMapRandomAccessCollection<MinimalRandomAccessCollection<LifetimeTracked>, LifetimeTracked>.Type.index(where:)/semantics",
"LazyMapCollection instances"

I can start taking a look at some of these tomorrow if you want.

@gribozavr
Copy link
Contributor

It would be great if you could look into these failures!

@austinzheng
Copy link
Contributor Author

@gribozavr Excellent, I'll take a look. If I can get the Map tests working perhaps I can PR those first separately, since there are only a few failures there. I'm also going to push a small change to make some of the failures more descriptive.

By the way, typeref_lowering_objc and typeref_lowering are also failing, but those tests should have nothing to do with my changes.

@gribozavr
Copy link
Contributor

If I can get the Map tests working perhaps I can PR those first separately, since there are only a few failures there.

Absolutely!

By the way, typeref_lowering_objc and typeref_lowering are also failing

Try rm -rf build/Ninja-ReleaseAssert/swift-macosx-x86_64 and rebuilding. There was a CMake change that needs to be picked up.

@gribozavr
Copy link
Contributor

build-script ....... --reconfigure should also work.

@austinzheng
Copy link
Contributor Author

@gribozavr I realized earlier that the non-lazy counterparts to the failing tests are dummied out (e.g. in Template.swift.gyb there's a FIXME). I assume those tests were dummied out because there was a bug in the test suite, collections API, or both.

I'm going to dummy out the tests in the lazy map suite until I figure out exactly what's going on. Fixing the FIXME can be a separate PR.

@austinzheng
Copy link
Contributor Author

More specifically, the GYB template appears as such:

CollectionTests.add${method}Tests(
    ...
    makeCollectionOfEquatable: { (elements: [MinimalEquatableValue]) in
      // FIXME: use LifetimeTracked.
      return ${test.base}(elements: elements)
    }, 
    wrapValueIntoEquatable: identityEq,
    extractValueFromEquatable: identityEq,
    ...
)

@gribozavr
Copy link
Contributor

More specifically, the GYB template appears as such:

If you're talking about the "use LifetimeTracked" comment, that is just a suggestion to improve testing. It is not indicating a bug or anything.

@austinzheng
Copy link
Contributor Author

I'll see if I can replicate the issue I'm seeing with the existing MinimalCollection tests then.

@austinzheng austinzheng changed the title Adding validation tests for LazyFilterCollection and LazyMapCollection Adding validation tests for LazyMapCollection Apr 28, 2016
@austinzheng
Copy link
Contributor Author

@gribozavr I've updated the PR with the following changes:

  • PR now only covers LazyMapCollection tests. The filter tests will come in another PR once I've troubleshooted them.
  • I replaced the test that was failing due to a memory leak (cf our email thread) with a FIXME.
  • I fixed the other tests that were failing.

This PR should pass CI successfully.

Let me know what you think.

@gribozavr
Copy link
Contributor

@swift-ci Please test and merge

@austinzheng
Copy link
Contributor Author

For future reference: I filed https://bugs.swift.org/browse/SR-1357, which is a possible bug uncovered by these tests.

@swift-ci swift-ci merged commit 893d2b4 into swiftlang:master Apr 29, 2016
@austinzheng austinzheng deleted the validation-tests branch April 29, 2016 01:31
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.

3 participants