Skip to content

Conversation

drodriguez
Copy link
Contributor

When running tests in an Android device, the environment variables
were not passed to the device, which make some test fail, like
stdlib/HashingRandomization that test with and without the
environment variable SWIFT_DETERMINISTIC_HASHING.

The changes implement a process similar to what the iOS simulator
already seem to do: a variable prefix which is pick up by the
adb_test_runner.py and send to the device for the test.

Besides that, to make the test pass, the test runner will not print the standard out with an extra newline at the end (from the Python print). This should make the output match the rest of the platforms more closely.

When running tests in an Android device, the environment variables
were not passed to the device, which make some test fail, like
stdlib/HashingRandomization that test with and without the
environment variable SWIFT_DETERMINISTIC_HASHING.

The changes implement a process similar to what the iOS simulator
already seem to do: a variable prefix which is pick up by the
adb_test_runner.py and send to the device for the test.
@@ -932,7 +932,8 @@ SIMULATOR_ENV_PREFIX = 'SIMCTL_CHILD_'
ENV_VAR_PREFIXES = {
'iphonesimulator': SIMULATOR_ENV_PREFIX,
'watchsimulator': SIMULATOR_ENV_PREFIX,
'appletvsimulator': SIMULATOR_ENV_PREFIX
'appletvsimulator': SIMULATOR_ENV_PREFIX,
'android': 'ANDROID_CHILD_'
Copy link
Member

Choose a reason for hiding this comment

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

Where does the prefix come from? Is there something special about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing special, except that it has to match here and in the script that invokes the binary on the Android device. The contents are more or less following the iOS simulator one, but that’s not necessary.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see, rather than create a new variable, you just inlined it. That makes sense.

@compnerd
Copy link
Member

@swift-ci please test and merge

@swift-ci swift-ci merged commit 3ab5e5c into swiftlang:master Oct 24, 2018
@drodriguez drodriguez deleted the android-adb_test_runner-envvars branch January 7, 2019 19:13
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