-
Notifications
You must be signed in to change notification settings - Fork 326
[Core] Route refresh integration test #4802
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
Conversation
| ] | ||
| ), | ||
| .testTarget( | ||
| name: "MapboxCoreNavigationIntegrationTests", |
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.
When added as a test target, these tests will be run as a part of required job, as a MapboxNavigation-Package step
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.
yes thank you, that was my intention. On our side we are mocking the network.
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.
discussed in chat - some tests, might be flaky, let's see on a couple of runs how it acts.
| let mappedUrlItem = queryItems!.first(where: { $0 == .customItem })! | ||
| self.customParameters = [mappedUrlItem] |
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.
Let's avoid using unnecessary ! to avoid crashes, even in tests.
| let mappedUrlItem = queryItems!.first(where: { $0 == .customItem })! | |
| self.customParameters = [mappedUrlItem] | |
| let mappedUrlItem = queryItems?.first(where: { $0 == .customItem }) | |
| self.customParameters = mappedUrlItem.map { [$0] } ?? [] |
| static let customItem: URLQueryItem = .init(name: "foo", value: "bar") | ||
| } | ||
|
|
||
| fileprivate final class CustomRouteOptions: NavigationRouteOptions { |
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.
There is already a class CustomRouteOptions in the TestHelper. Is it possible to reuse it there somehow?
| } | ||
|
|
||
| func testRouteRefreshWithCustomDrivingTrafficProfile() { | ||
| simulateAndTestOnRoute(with: .custom, shouldRefresh: true) |
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.
could you please rename .custom to .customDrivingTraffic so it's clear we don't refresh any custom profile, only the custom driving-traffic?
| } | ||
|
|
||
| func testRouteRefreshWithWalkingProfile() { | ||
| simulateAndTestOnRoute(with: .walking, shouldRefresh: false) |
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.
Could you please also add a separate test for
simulateAndTestOnRoute(with: .automobile, shouldRefresh: false)
Description
Merge request contains only integration tests.
Covers: