-
-
Notifications
You must be signed in to change notification settings - Fork 197
Fix unit test runner on Windows #1207
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In `karma-nativescript-launcher` we call startTestRunner through spawn. Communication between karma launcher and tns is through stdin. This is causing exception in buildMetadata step when gradle wrapper is used. For some reason it throws error in java code. So, replace the spawn with fork in the launcher. Modify `startTestRunner` to wait for message from parent process and send "ready" state to the parent. After that the parent (karma-nativescript-launcher) sends configuration data and the `startTestRunner` will execute the actions. Fixes #1199
Test PASSed. |
1 similar comment
Test PASSed. |
👍 |
As the current workflow of unit-testing is: 1) user calls `tns test android` 2) CLI starts a new process in which `tns dev-test android` is called 3) In case the dev-test command fails, the error is caught in the child process and command help is printed on the terminal directly in it. 4) User receives message: `Unable to find command dev-test|android` (from the child process) as we do not have help for this commands. Copy-paste the help fo test-android and test-ios commands and change the filenames so when the child process fails, it will print correct help. Parent process will not fail as the error is caught inside the child, so there's no way to print the help twice. Update common-lib to search dev-commands as well when searching for help pages.
In case node_modules dir is deleted, `tns test <platform>` command will fail. So ensure all dependencies are installed before starting karma server.
3b5762e
to
6925a14
Compare
Test PASSed. |
} | ||
}; | ||
|
||
let notInstalledAppOnDeviceAction = (device: Mobile.IDevice): IFuture<void> => { |
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.
I think we can move these callbacks outside the body of startTestRunner.
rosen-vladimirov
added a commit
that referenced
this pull request
Nov 18, 2015
…unner Fix unit test runner on Windows
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use fork instead of spawn for startTestRunner
In
karma-nativescript-launcher
we call startTestRunner through spawn.Communication between karma launcher and tns is through stdin.
This is causing exception in buildMetadata step when gradle wrapper is used.
For some reason it throws error in java code.
So, replace the spawn with fork in the launcher. Modify
startTestRunner
to wait for message from parent process and send "ready" state to the parent.After that the parent (karma-nativescript-launcher) sends configuration data and the
startTestRunner
will execute the actions.Fixes #1199
Add help for dev-test-* commands
As the current workflow of unit-testing is:
tns test android
tns dev-test android
is calledUnable to find command dev-test|android
(from the child process) as we do not have help for this commands.Copy-paste the help fo test-android and test-ios commands and change the filenames so when the child process fails, it will print correct help.
Parent process will not fail as the error is caught inside the child, so there's no way to print the help twice.
Update common-lib to search dev-commands as well when searching for help pages.
Make sure all dependencies are installed before starting karma
In case node_modules dir is deleted,
tns test <platform>
command will fail.So ensure all dependencies are installed before starting karma server.
Should be merged after: