-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
L0 tests for Xamarin tasks #1732
Conversation
jpricket
commented
May 16, 2016
- This PR includes lots of tests for XamarinAndroid, XamarinRestoreComponent, XamarinTestCloud, and XamariniOS. The tests for XamarinLicense are limited because the task cannot be easily mocked.
- I added the ability for which(..., true) to call CheckPath in the test library to allow for testing the scenario when it doesn't exist. This required updating lots of response files for tests that didn't have the CheckPath set on the paths that which returned.
xbuildToolPath = xbuildLocation + '/xbuild'; | ||
xbuildToolPath = path.join(xbuildLocation, 'xbuild'); | ||
if (!tl.exist(xbuildToolPath)) { | ||
xbuildToolPath = path.join(xbuildLocation, 'xbuild.exe'); |
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.
Why are we doing the explicit check for xbuild.exe?
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.
This was to handle running it on Windows or *nix. On Windows it has the extension .exe, but not on other OSes. Is there a better way?
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 a way to check for os version like we do in Xamarin Licensing task.
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.
Unfortunately, there isn't a way to mock that OS check. That's why I tried to avoid that here. The TaskLib really needs a method that allows the task to check the OS (tl.isWin). That way it could be mocked and all paths can be fully tested.
Looks good to me with minor comments. |
…ges to mock task-lib)
… CheckPath in the test library.
- no need to log inputs, getInput does that - don't use tl.exit, use setResult
49b214d
to
dec1b9c
Compare