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

Mock xcrun calls #373

Merged
merged 2 commits into from
May 3, 2019
Merged

Mock xcrun calls #373

merged 2 commits into from
May 3, 2019

Conversation

imurchie
Copy link
Contributor

Three unit tests still actually made system calls to xcrun. Mock those.

@mykola-mokhnach Can you run the existing utils unit tests (npm run build && npx mocha -R spec build/test/unit/utils-specs.js) before trying this patch? If the same three TypeError errors come up, then that kind of confirms this is the place. Then with this patch those should be gone.

That would also confirm that the problem is somewhere in the system call, which sucks. I would suggest at that point going into teen_process and trying to exec the xcrun --sdk iphonesimulator --show-sdk-version and see where the error comes up.

I wish I could reproduce this so I could investigate. :(

@mykola-mokhnach
Copy link
Contributor

mykola-mokhnach commented Apr 27, 2019

npm run build && npx mocha -R spec build/test/unit/utils-specs.js

> appium-ios-driver@4.2.2 build /Users/elf/code/appium-ios-driver
> gulp transpile

[07:46:20] Using gulpfile ~/code/appium-ios-driver/gulpfile.js
[07:46:20] Starting 'transpile'...
[07:46:24] Finished 'transpile' after 4.01 s


  prepareIosOpts
    ✓ should use instruments without delay by default
    ✓ should use instruments without delay if explicitly not using native instruments
    ✓ should not use instruments without delay if using native intruments


  3 passing (22ms)

These are fine

@mykola-mokhnach
Copy link
Contributor

Also I cannot imagine how undefined could be returned from teen_process, because it can ONLY resolve to a dictionary: https://github.com/appium/node-teen_process/blob/30ab25a454b19507a3050fa9dd6613d6edb6470b/lib/exec.js#L92

utils.prepareIosOpts(opts);
opts.withoutDelay.should.be.true;
});
it('should not use instruments without delay if using native intruments', function () {
let opts = {nativeInstrumentsLib: true};
const opts = {nativeInstrumentsLib: true};
utils.prepareIosOpts(opts);
Copy link
Contributor

Choose a reason for hiding this comment

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

this is an async call, btw

@imurchie imurchie merged commit a17e317 into master May 3, 2019
@imurchie imurchie deleted the isaac-tests branch May 3, 2019 15:02
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.

None yet

2 participants