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

Windows Unit Tests All Fixed (fix #402) #404

Merged
merged 1 commit into from
Aug 26, 2015

Conversation

brunobowden
Copy link
Contributor

Major:

Minor:

  • Fake OS specific file and path separators
  • Explicit setFakeOS methods, e.g. setFakeOSWindows()
  • Default to using native OS rather than fake OS for most unit tests
  • Small number of unit tests use fakeOSName
  • ‘inTestMustFakeOS’ setting removed

@brunobowden
Copy link
Contributor Author

@advayDev1 - ignore for now, still in progress

@brunobowden brunobowden changed the title Fixing Windows Unit Tests - file/path separators Fixing Windows Unit Tests (fixes #402) Aug 25, 2015
@brunobowden
Copy link
Contributor Author

@advayDev1 and @gocursor - I've gone through and fixed up all the unit tests on Windows. A small number (~4) were disabled with TODOs. This was complicated by not having a Windows machine ;-). @cursor, if you could look at trying to fix some of the disabled Windows tasks marked with TODOs, that would be helpful, in particular it needs a substitute for running 'echo' on the command line.

@advayDev1 - I still have one weird failure locally but it doesn't happen on the build bots. Very happy to see this all working:

screen shot 2015-08-25 at 4 00 15 pm

@brunobowden brunobowden changed the title Fixing Windows Unit Tests (fixes #402) Windows Unit Tests Fix (fixes #402) Aug 25, 2015
@@ -99,6 +135,29 @@ class Utils {
}
}

// Same as File.separator but can mocked using fakeOSName
Copy link
Contributor

Choose a reason for hiding this comment

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

s/mocked/faked/ below as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@advayDev1
Copy link
Contributor

Awesome - really nice work!

Can you add to CONTRIBUTING.md style guide the canonical way to construct a file paths such that they work across platforms and across fakes OSes? I see sometimes you using new File(parent, child).absolutePath and sometime concating with the Utils separator.

@brunobowden
Copy link
Contributor Author

@advayDev1 - PTAL, this is all fixed up, including the local failure that @gocursor also saw. It should be ready for a LGTM now.

// https://github.com/j2objc-contrib/j2objc-gradle/issues/422
String executableCmd = 'echo'
if (Utils.isWindowsNoFake()) {
// executableCmd = '????'
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like your new echo solution is needed here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Fixed that up too.

@advayDev1
Copy link
Contributor

LGTM. see 1 comment in the code and also please respond to my comment above:

Can you add to CONTRIBUTING.md style guide the canonical way to construct a file paths such that they work across platforms and across fakes OSes? I see sometimes you using new File(parent, child).absolutePath and sometime concating with the Utils separator.

@brunobowden
Copy link
Contributor Author

I'll add the section to CONTRIBUTING in my next PR. Just waiting on builds and then I'll merge.

@advayDev1
Copy link
Contributor

sg

Major:
- Fix j2objc-contrib#402 - Windows 37 unit tests failures
- Fix j2objc-contrib#422 - echo command fails on Windows
- Disabled only failing test on Windows: j2objc-contrib#374

Minor:
- Fake OS specific file and path separators
- Explicit setFakeOS methods, e.g. setFakeOSWindows()
- Default to using native OS rather than fake OS for most unit tests
- Small number of unit tests use fakeOSName
- ‘inTestMustFakeOS’ setting removed
@brunobowden brunobowden changed the title Windows Unit Tests Fix (fixes #402) Windows Unit Tests All Fixed (fix #402) Aug 26, 2015
brunobowden added a commit that referenced this pull request Aug 26, 2015
Windows Unit Tests All Fixed (fix #402)
@brunobowden brunobowden merged commit 69f77aa into j2objc-contrib:master Aug 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants