-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Improve AppVeyor Build #505
Open
mvz
wants to merge
7
commits into
main
Choose a base branch
from
improve-appveyor-build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+34
−16
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
09deb34
Run cucumber scenarios on Windows
mvz 8609a39
Temporarily limit set of platforms
mvz 8546717
Add bat runner for default test cli app
mvz 164530b
CI: Fixed `#run_command` spec on Windows.
xtrasimplicity fdede17
CI: Fixed `#to_be_successfully_executed` and `#to_have_exit_status`
xtrasimplicity ccec6c4
CI: Fixed `#set_environment_variable` on Windows
xtrasimplicity dbe36bb
CI - Windows: RSpec specs are all working!
xtrasimplicity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@ECHO OFF | ||
IF NOT "%~f0" == "~f0" GOTO :WinNT | ||
@"ruby.exe" "./aruba-test-cli" %1 %2 %3 %4 %5%6 %7 %8 %9 | ||
GOTO :EOF | ||
:WinNT | ||
@"ruby.exe" "%~dpn0" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,10 @@ | |
include_context "uses aruba API" | ||
|
||
describe "#run_command" do | ||
let(:cmd) { 'ruby -ne "puts $_"' } | ||
|
||
context "when succesfully running a command" do | ||
before { @aruba.run_command "cat" } | ||
before { @aruba.run_command cmd } | ||
|
||
after { @aruba.all_commands.each(&:stop) } | ||
|
||
|
@@ -33,6 +35,15 @@ | |
@aruba.write_file(@file_name, "Hello\nWorld!") | ||
@aruba.pipe_in_file(@file_name) | ||
@aruba.close_input | ||
|
||
@aruba.last_command_started.stop | ||
last_command_output = @aruba.last_command_started.output | ||
|
||
# Convert \r\n to \n, if present in the output | ||
if last_command_output.include?("\r\n") | ||
allow(@aruba.last_command_started).to receive(:output).and_return(last_command_output.gsub("\r\n", "\n")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe better to either:
I think I prefer the third option for now. |
||
end | ||
|
||
expect(@aruba.last_command_started).to have_output "Hello\nWorld!" | ||
end | ||
end | ||
|
@@ -47,7 +58,7 @@ | |
end | ||
|
||
it "raises an error" do | ||
expect { @aruba.run_command "cat" }.to raise_error NotImplementedError | ||
expect { @aruba.run_command cmd }.to raise_error NotImplementedError | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Windows doesn't have a command like
cat
that accepts input viastdin
, prints it tostdout
and accepts piped input, so this is the best I've come up with but it feels a little hack-y. @mvz, do you happen to know of any better ways to tackle this? Can you see any issues with this implementation? Thanks heaps!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.
Would something lets
gets.chomp
work here. Via an input on stdin? Genuinely not sure, so ignore me if not useful.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.
That almost works, but the process exits immediately afterwards. I can add a loop and trap an interrupt signal, but it's a fair bit more verbose. I've also found it doesn't quite function in the same way that
cat
does. Thanks heaps for the suggestion, though. :)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.
@xtrasimplicity I can't remember what the Windows-equivalent command was.
type
, maybe? I kind of like your change because it's Just Ruby, but it may slow down tests on JRuby. Let's see how this goes for now.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.
Thanks, @mvz.
type
was almost perfect, from memory, but I don't think it handledSIGINT
signals (or the windows equivalent) correctly. I'll keep it as is for the moment and see how it goes. :)