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

L0 tests for Xamarin tasks #1732

Merged
merged 7 commits into from
May 16, 2016
Merged

L0 tests for Xamarin tasks #1732

merged 7 commits into from
May 16, 2016

Conversation

jpricket
Copy link
Member

  • 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');
Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member Author

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.

@madhurig
Copy link
Contributor

Looks good to me with minor comments.

@jpricket jpricket force-pushed the users/jpricket/L0 branch from 49b214d to dec1b9c Compare May 16, 2016 20:52
@jpricket jpricket merged commit f4585f2 into master May 16, 2016
@bryanmacfarlane bryanmacfarlane deleted the users/jpricket/L0 branch August 3, 2016 09:57
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