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

app CI integration testing for Windows support #262

Open
mroth opened this issue Feb 22, 2015 · 25 comments
Open

app CI integration testing for Windows support #262

mroth opened this issue Feb 22, 2015 · 25 comments

Comments

@mroth
Copy link
Member

mroth commented Feb 22, 2015

Now that AppVeyor is around, it looks like we can theoretically add Windows continuous integration testing as well (it would be nice if TravisCI supported it, but I don't see that happening soon). This would enhance our ability to make sure builds don't break in Windows over time (since none of the core developers are Windows users) and give us more confidence about supporting without caveat what has historically been for us, if we are honest, not a first-class supported platform.

Ideally we could find someone who is a Windows developer familiar with AppVeyor to take this task on.

@matthutchinson
Copy link
Member

👍 Good idea, until now when making any major changes to the gem or plugins I run it through a VM I have setup with Windows 7 and cygwin.

@nysthee
Copy link
Contributor

nysthee commented Apr 13, 2015

I'm willing to look this trough. If I'm right the goal is duplication of the travis-flow (or at least test the same things) in AppVeyor?

@nysthee
Copy link
Contributor

nysthee commented Apr 14, 2015

@mroth is there an existing account for AppVeyor or should is make one of my own testing with my fork?

@mroth
Copy link
Member Author

mroth commented Apr 14, 2015

@nysthee I think I have an account on AppVeyor but nothing is set up on it. It was tied to my GitHub auth anyhow, so I think you'll need to use your own, similar to the Travis model?

@nysthee
Copy link
Contributor

nysthee commented Apr 14, 2015

What do you mean by similar to the Travis model?

@mroth
Copy link
Member Author

mroth commented Apr 14, 2015

Just that Travis-CI uses GitHub Auth for accounts, so each developer needs their own account.

@nysthee
Copy link
Contributor

nysthee commented Apr 14, 2015

I will start working on this later this evening.

2015-04-14 21:29 GMT+02:00 Matthew Rothenberg notifications@github.com:

Just that Travis-CI uses GitHub Auth for accounts, so each developer needs
their own account.


Reply to this email directly or view it on GitHub
#262 (comment).

@nysthee
Copy link
Contributor

nysthee commented Apr 14, 2015

Looks like the build queues on appveyor are huge. :)

@nysthee
Copy link
Contributor

nysthee commented Apr 14, 2015

@matthutchinson can you tell a little bit more on the setup of your win 7 vm, issues you encountered, etc... . At the moment lolcommits_test.rb is failing on incorrect file permissions.

@matthutchinson
Copy link
Member

hmm, that was a while ago, I may no longer have the vm, will check later when I'm home and see. Can you paste the failure message you get?

@nysthee
Copy link
Contributor

nysthee commented Apr 15, 2015

1) Failure:
LolTest#test_permissions [C:/projects/lolcommits/test/lolcommits_test.rb:28]:
expected perms of 755/775 but instead got 644

@matthutchinson
Copy link
Member

Just checked and I no longer have the VM 😢

I'll try to set it up again this weekend and see if I run into any issues.

@matthutchinson
Copy link
Member

So I spent quite a bit of time yesterday trying to get a Windows 8.1 VM setup and working again with the current lolcommits version (0.5.7).

Before even running tests I noticed a bunch of problems on getting the hook/capture to work at all. This commit and this PR.

Running the tests now, I've got the same issue as you, so I'll dig into that further. It should be noted that I don't think we've ever had a working test suite running on a Windows machine before (unless @mroth can recall..)

@mroth
Copy link
Member Author

mroth commented Apr 20, 2015

Yeah, we've never even tried the tests there before AFAIK.

Great work on the patches @matthutchinson.

Just curious , where you able to get it working even omitting the dev-headers versions of Ruby/Imagemagick? I suspect we can skip those steps now that we have migrated from RMagick->RubyMagick, and that could simplify our setup wiki instructions for Windows users substantially. (see #261 for context)

@matthutchinson
Copy link
Member

We're still using the mini_magick which requires ImageMagick.. I don't think we've ever taken the leap to use RubyMagick..

Ignore me, yes you're right we no longer use RMagick, so we can ommit that step altogether.

@mroth
Copy link
Member Author

mroth commented Apr 20, 2015

Whoops, yeah I meant MiniMagick, brain typo.

@nysthee
Copy link
Contributor

nysthee commented Apr 21, 2015

IMO it is not very useful (as it will never work) to test unix-file permissions on a Windows machine. Ik wi try to work around this particular test.

@matthutchinson
Copy link
Member

I Agree..

Interestingly the ImpactFont and the CommandCam permissions DO pass on
Windows (ImageSnap and VideoSnap do not)
This may be down to 2 things;

  • Windows default perms for files is indicated as 644 by the Ruby
    File.stat method (see last paragraph here:
    http://ruby-doc.org/core-2.2.2/File.html)
  • Windows application files (.exe) like CommandCam must be treated
    differently since they can be ran as an application, and report as 755

So perhaps for this test, we bypass checking the perms for VideoSnap and
ImageSnap on the Windows platform?

The next hurdle I came up against was getting Cucumber/Gherkin working on
Windows. There seems to be some magic combination of Ruby version +
Windows version that cucumber/gherkin will work with.

Some posts suggest using only Windows 7 32-bit, others say use Ruby 2.0 or
1.9.3 only for windows compatibility with cukes... 3 vms already and I've
yet to find the magic formula. Will let you know if I do...

On 21 April 2015 at 08:01, Thomas Nys notifications@github.com wrote:

IMO it is not very useful (as it will never work) to test unix-file
permissions on a Windows machine. Ik wi try to work around this particular
test.


Reply to this email directly or view it on GitHub
#262 (comment).

Matthew Hutchinson
Technical Director, Hiddenloop Ltd
Tel. 0044 7526102695
The Garden Flat, 20a Girdlers Road, London, W14 0PU
matt@hiddenloop.com / matthewhutchinson.net

@matthutchinson
Copy link
Member

@mroth - i've updated the Windows wiki page a little, there are a few less steps now, but we do still need the Ruby Development Kit installed and configured, since the oj gem (a dependency of the yammer plugin) requires C extensions to be built on installing.

I think when we move plugins out of the main gem, we can ditch this requirement, and press plugin developers to provide their own tips for Windows compatibility..

https://github.com/mroth/lolcommits/wiki/Installing-on-Windows

Also, as it stands v0.5.7 will not work on any version of windows out of the box right now, i'd like to release v0.5.8 tonight (from current master) unless you have any objections?

@matthutchinson
Copy link
Member

So after a lot of investigation (and many VM's) I was finally able to get the tests to run (with some success) Gherkin problems mean only Windows 7 (32bit) with Ruby 2.0.0 or 1.9.3 (with RubyDevKit installed) can be used.

Currently, gherkin/cucumber fails for Ruby 2.1/2.2 on any Windows box or any 64 bit version of Windows.

So here is the output from that run (after skipping those file permission unit tests), not very encouraging, but a least a starting point (33 failed, 113 skipped, 66 passed) ...

C:\lolcommits>bundle exec rake
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansicon/) to get coloured output on Windows
Running RuboCop...
Inspecting 39 files
.......................................

39 files inspected, no offenses detected
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's default settings.
Run options: --seed 21112

# Running:

LolTest .
PluginsTest ...

Finished in 0.015600s, 256.4103 runs/s, 641.0256 assertions/s.

4 runs, 10 assertions, 0 failures, 0 errors, 0 skips
[Coveralls] Outside the CI environment, not sending data.
Using the default profile...
Bug regression testing ..F---.F-.F-F----.F-----
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  ./features/step_definitions/lolcommits_steps.rb:44:in `/^I am in a git repo named "(.*?)" with lolcommits enabled$/'
  features\bugs.feature:13:in `Given I am in a git repo named "test lolol" with lolcommits enabled'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\bugs.feature:33:in `When I successfully run `lolcommits`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\bugs.feature:43:in `When I successfully run `lolcommits`'
  symlink() function is unimplemented on this machine (NotImplementedError)
  C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:349:in `symlink'
  C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:349:in `block in ln_s'
  C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:1574:in `fu_each_src_dest0'
  C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:347:in `ln_s'
  C:/lolcommits/features/support/path_helpers.rb:35:in `block in preseve_cmds_in_path'
  C:/lolcommits/features/support/path_helpers.rb:32:in `each'
  C:/lolcommits/features/support/path_helpers.rb:32:in `preseve_cmds_in_path'
  C:/lolcommits/features/support/path_helpers.rb:12:in `reject_paths_with_cmd'
  C:/lolcommits/features/support/env.rb:44:in `Before'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  ./features/step_definitions/lolcommits_steps.rb:44:in `/^I am in a git repo named "(.*?)" with lolcommits enabled$/'
  features\bugs.feature:65:in `Given I am in a git repo named "whatev" with lolcommits enabled'
Basic UI functionality ..F--..F-..F-..F---...F-----...F---..F--.F----..F--...F--
---.F-----.F--------...F--.F----.F-..F---------..F--------..F---.F---...F-.....F
--..F--...F--...F-.....F--..F--.F---.F-----.F---F-----
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:7:in `When I get help for "lolcommits"'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:13:in `When I get help for "lolcommits"'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:20:in `When I get help for "lolcommits"'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:25:in `When I successfully run `lolcommits --enable`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:33:in `When I successfully run `lolcommits --enable`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:43:in `And I run `lolcommits --enable`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:50:in `When I successfully run `lolcommits --enable -w 5 --fork`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  ./features/step_definitions/lolcommits_steps.rb:44:in `/^I am in a git repo named "(.*?)" with lolcommits enabled$/'
  ./features/step_definitions/lolcommits_steps.rb:51:in `/^I am in a git repo with lolcommits enabled$/'
  features\lolcommits.feature:55:in `Given I am in a git repo with lolcommits enabled'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:63:in `When I run `lolcommits --enable`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:73:in `When I successfully run `lolcommits --capture --fork`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  ./features/step_definitions/lolcommits_steps.rb:44:in `/^I am in a git repo named "(.*?)" with lolcommits enabled$/'
  features\lolcommits.feature:81:in `Given I am in a git repo named "myrepo" with lolcommits enabled'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  ./features/step_definitions/lolcommits_steps.rb:44:in `/^I am in a git repo named "(.*?)" with lolcommits enabled$/'
  features\lolcommits.feature:89:in `Given I am in a git repo named "testcapture" with lolcommits enabled'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:102:in `When I run `lolcommits --stealth --capture`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  ./features/step_definitions/lolcommits_steps.rb:44:in `/^I am in a git repo named "(.*?)" with lolcommits enabled$/'
  ./features/step_definitions/lolcommits_steps.rb:51:in `/^I am in a git repo with lolcommits enabled$/'
  features\lolcommits.feature:107:in `Given I am in a git repo with lolcommits enabled'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:114:in `When I successfully run `lolcommits --plugins`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:119:in `When I run `lolcommits --config` interactively'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:132:in `When I run `lolcommits --config --test` interactively'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:144:in `When I run `lolcommits --test --capture`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  ./features/step_definitions/lolcommits_steps.rb:44:in `/^I am in a git repo named "(.*?)" with lolcommits enabled$/'
  features\lolcommits.feature:150:in `Given I am in a git repo named "randomgitrepo" with lolcommits enabled'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:158:in `When I run `lolcommits --last`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:166:in `When I run `lolcommits --last`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:176:in `When I run `lolcommits --last`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:186:in `When I run `lolcommits --last`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:196:in `When I run `lolcommits --browse`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:204:in `When I run `lolcommits --browse`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  features\lolcommits.feature:214:in `When I run `lolcommits --browse`'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  ./features/step_definitions/lolcommits_steps.rb:44:in `/^I am in a git repo named "(.*?)" with lolcommits enabled$/'
  ./features/step_definitions/lolcommits_steps.rb:51:in `/^I am in a git repo with lolcommits enabled$/'
  features\lolcommits.feature:222:in `Given I am in a git repo with lolcommits enabled'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  ./features/step_definitions/lolcommits_steps.rb:44:in `/^I am in a git repo named "(.*?)" with lolcommits enabled$/'
  features\lolcommits.feature:228:in `Given I am in a git repo named "giffy" with lolcommits enabled'
  The system cannot find the file specified. (2) (Aruba::LaunchError)
  ./features/step_definitions/lolcommits_steps.rb:44:in `/^I am in a git repo named "(.*?)" with lolcommits enabled$/'
  features\lolcommits.feature:236:in `Given I am in a git repo named "sunday" with lolcommits enabled'
  symlink() function is unimplemented on this machine (NotImplementedError)
  C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:349:in `symlink'
  C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:349:in `block in ln_s'
  C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:1574:in `fu_each_src_dest0'
  C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:347:in `ln_s'
  C:/lolcommits/features/support/path_helpers.rb:35:in `block in preseve_cmds_in_path'
  C:/lolcommits/features/support/path_helpers.rb:32:in `each'
  C:/lolcommits/features/support/path_helpers.rb:32:in `preseve_cmds_in_path'
  C:/lolcommits/features/support/path_helpers.rb:12:in `reject_paths_with_cmd'
  C:/lolcommits/features/support/env.rb:49:in `Before'
Plugins Work .

Failing Scenarios:
cucumber features\bugs.feature:12 # Scenario: handle git repos with spaces in directory name
cucumber features\bugs.feature:32 # Scenario: don't warn about system_timer (on MRI 1.8.7)
cucumber features\bugs.feature:42 # Scenario: don't want initialized constant warning from Faraday (MRI 1.8.7)
cucumber features\bugs.feature:53 # Scenario: gracefully fail when imagemagick is not installed
cucumber features\bugs.feature:64 # Scenario: catch upstream bug with ruby-git and color=always
cucumber features\lolcommits.feature:6 # Scenario: App just runs
cucumber features\lolcommits.feature:11 # Scenario: Help should show the animate option on a Mac platform
cucumber features\lolcommits.feature:18 # Scenario: Help should not show the animate option on a Windows plaftorm
cucumber features\lolcommits.feature:23 # Scenario: Enable in a naked git repo
cucumber features\lolcommits.feature:30 # Scenario: Enable in a git repo that already has a post-commit hook
cucumber features\lolcommits.feature:40 # Scenario: Enable in a git repo that has post-commit hook with a bad shebang
cucumber features\lolcommits.feature:48 # Scenario: Enable in a git repo passing capture arguments
cucumber features\lolcommits.feature:54 # Scenario: Disable in a enabled git repo
cucumber features\lolcommits.feature:61 # Scenario: Trying to enable while not in a git repo fails
cucumber features\lolcommits.feature:70 # Scenario: Capture doesnt break in forked mode
cucumber features\lolcommits.feature:80 # Scenario: Commiting in an enabled repo triggers successful capture
cucumber features\lolcommits.feature:88 # Scenario: Commiting in enabled repo subdirectory triggers successful capture
cucumber features\lolcommits.feature:99 # Scenario: Stealth mode does not alert the user
cucumber features\lolcommits.feature:106 # Scenario: Commiting in stealth mode captures without alerting the committer
cucumber features\lolcommits.feature:113 # Scenario: Show plugins
cucumber features\lolcommits.feature:117 # Scenario: Configuring plugin
cucumber features\lolcommits.feature:130 # Scenario: Configuring plugin in test mode affects test loldir not repo loldir
cucumber features\lolcommits.feature:142 # Scenario: test capture should work regardless of whether in a git repo
cucumber features\lolcommits.feature:149 # Scenario: test capture should store in its own test directory
cucumber features\lolcommits.feature:155 # Scenario: last command should work properly when in a lolrepo
cucumber features\lolcommits.feature:161 # Scenario: last command should work properly when in a lolrepo subdirectory
cucumber features\lolcommits.feature:174 # Scenario: last command should fail gracefully if not in a lolrepo
cucumber features\lolcommits.feature:183 # Scenario: last command should fail gracefully if zero lolimages in lolrepo
cucumber features\lolcommits.feature:193 # Scenario: browse command should work properly when in a lolrepo
cucumber features\lolcommits.feature:199 # Scenario: browse command should work properly when in a lolrepo subdirectory
cucumber features\lolcommits.feature:212 # Scenario: browse command should fail gracefully when not in a lolrepo
cucumber features\lolcommits.feature:221 # Scenario: handle commit messages with quotation marks
cucumber features\lolcommits.feature:227 # Scenario: generate gif should store in its own archive directory
cucumber features\lolcommits.feature:235 # Scenario: generate gif with argument 'today'
cucumber features\lolcommits.feature:254 # Scenario: gracefully fail when ffmpeg not installed and --animate is used

35 scenarios (35 failed)
212 steps (33 failed, 113 skipped, 66 passed)
0m4.555s

@nysthee if you have more luck than me, let us know 😄

Ps.. Obviously if we want AppVeyor integration this needs to be passing..

@nysthee
Copy link
Contributor

nysthee commented Apr 24, 2015

I will put up a windows 2012 server this weekend (what appveyor uses - x64 only), to dig deeper into this. It doesn't look very encouraging. :D

@matthutchinson
Copy link
Member

OK, good luck!

@mroth and I were talking and depending on your success, it might be better (for a first step) to only attempt to get a subset of the features passing under Windows. E.g. for the happy path of installing the hook, and capturing a commit.

You could use cuke tags (like the @mac-only tag) we currently have, to choose what to run in AppVeyor builds.

@nysthee
Copy link
Contributor

nysthee commented Jun 19, 2015

I must apologise for the silence but in between my internship, passing exams and a new job I didn't had to much time advancing on this issue. I have a basic appveoyr.yml set up and who basically gives the same output as @matthutchinson's trace above. Also some extra fun I ran into:

  • the imagemagick chocolatey package is poorly maintained (and takes ages to install)
  • Ruby 1.8.7 is not supported in appveyor (basically the ci runner uses 1.9.3 as an alternative)
  • Also the run on 1.9.3 breaks on the installation of ansi-term gem, that needs another version of ruby gems. Installing the latest one just blocks the runner.

Can one of you guys give me a short overview of what exactly needs to pass as a baseline and I will give it a final try.

@matthutchinson
Copy link
Member

Sorry, i've been on holiday for the last 2 weeks 🍹

I think the best way forward for now is if you add cuke tags e.g. @win-only to the tests that currently do pass under Windows. Then we'll add another issue here on GitHub to request that ALL tests should pass in Windows.

Thanks for all the work you've done so far on Appveyor integration.

If its possible can you invite me to the Appveyor project you've created, so I can manage it too? My GitHub username 'matthutchinson' is associated with my account there. Or issue a PR with the relevant Appveyor YAML file.

@nysthee
Copy link
Contributor

nysthee commented Jun 29, 2015

Feature/appveyor ci #280 contains the yaml file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants