Skip to content
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

Functional tests from Swift Package Manager #17

Merged
merged 1 commit into from
Feb 1, 2020
Merged

Conversation

uranusjr
Copy link
Member

@uranusjr uranusjr commented Feb 1, 2020

I think I’ve got most things right, but 3/4 of the resolution results are slightly different (each with one discrepancy). Not sure if this is a functional difference between implementations; will need to look into those.

# Kitura
{'https://github.com/IBM-Swift/BlueSocket.git': '0.12.0'} != {'https://github.com/IBM-Swift/BlueSocket.git': '0.12.4'}
{'https://github.com/IBM-Swift/CCurl.git': '0.3.7'} != {'https://github.com/IBM-Swift/CCurl.git': '0.2.3'}

# PerfectHTTPServer
{'https://github.com/PerfectlySoft/PerfectLib.git': '2.0.0'} != {'https://github.com/PerfectlySoft/PerfectLib.git': '2.0.4'}
{'https://github.com/PerfectlySoft/Perfect-Net.git': '2.0.0'} != {'https://github.com/PerfectlySoft/Perfect-Net.git': '2.0.5'}

# SourceKitten
# Passes \o/

# ZewoHTTPServer
{'https://github.com/Zewo/CLibvenice.git': '0.15.0'} != {'https://github.com/Zewo/CLibvenice.git': '0.14.0'}

Assuming both are correct, neither resolver is “superior” IMO since each got newer packages in some cases.

@uranusjr uranusjr force-pushed the functional-tests branch 6 times, most recently from 3b92d8a to ed82e2b Compare February 1, 2020 14:02
@uranusjr
Copy link
Member Author

uranusjr commented Feb 1, 2020

For ZewoHTTPServer, all requests to CLibvenice ask for {'0.14.0', '0.15.0'}. CLibvenice has no dependencies. Therefore both 0.14.0 and 0.15.0 are correct, and ResolveLib picks the higher one (as implemented in the provider).

(Note: Four candidates ask for CLibvenice: Venice 0.14.0, File 0.14.0, TCP 0.14.0, and IP 0.14.0.)

The reason Swift Package Manager chooses the lower one may be the Minimal Version Selection principal, which prefers lower versions to higher if both satisfy the constraints.

This should theoretically be implementable by modifying find_matches() to prefer candidates with lower versions (i.e. put them last instead of first). But interestingly this causes the resolver to throw ResolutionImpossible. It is clear we are missing some backtrack possibilities.

@uranusjr
Copy link
Member Author

uranusjr commented Feb 1, 2020

Merging since I am implementing the tests correctly. The fact they fail is a good thing. The causes should be tracked by subsequent issues.

@uranusjr uranusjr marked this pull request as ready for review February 1, 2020 14:19
@uranusjr uranusjr merged commit 9362850 into master Feb 1, 2020
@uranusjr uranusjr deleted the functional-tests branch February 1, 2020 14:21
@uranusjr uranusjr added this to Doing in Resolver improvements via automation Feb 2, 2020
@uranusjr uranusjr moved this from Doing to Done in Resolver improvements Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant