-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cucumber/aruba-based automated tests
They are meant to match more or less the tutorial scripts. The main difference is probably going to be UI.
- Loading branch information
Showing
8 changed files
with
213 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default: --fail-fast |
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 |
---|---|---|
|
@@ -23,3 +23,6 @@ | |
data/tree.yml | ||
|
||
draft/ | ||
|
||
vendor/ | ||
tmp/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Feature: Installation | ||
@disable-bundler | ||
Scenario: Bootstrapping | ||
# High timeout, we're building and installing stuff | ||
Given the aruba exit timeout is 3600 seconds | ||
# High timeout because of variability due to network access | ||
Given the default answer timeout is 3600 seconds | ||
|
||
When I run the following script: | ||
"""bash | ||
mkdir dev | ||
cd dev | ||
""" | ||
When I cd to "dev" | ||
And I run the following script: | ||
"""bash | ||
wget http://rock-robotics.org/autoproj_bootstrap | ||
""" | ||
Then the following files should exist: | ||
| autoproj_bootstrap | | ||
|
||
When I run the following script interactively: | ||
"""bash | ||
ruby autoproj_bootstrap git \ | ||
https://github.com/rock-gazebo/buildconf | ||
""" | ||
And I answer "" to "Which prepackaged software" | ||
And I answer "" to "The current directory is not empty, continue bootstrapping anyway ?" | ||
When I stop the command started last | ||
Then the exit status should be 0 | ||
Then the output should contain "successfully" | ||
|
||
When I run the following script interactively: | ||
"""bash | ||
set -e | ||
echo $PWD | ||
source env.sh | ||
aup --all -k | ||
amake --all -k | ||
""" | ||
And I answer "" to "How should I interact with gitorious.org" | ||
And I answer "" to "How should I interact with github.com" | ||
And I answer "" to "whether C++11 should be enabled" | ||
And I answer "" to "Do you need compatibility with OCL ?" | ||
And I answer "" to "the target operating system for Orocos/RTT" | ||
And I answer "" to "which CORBA implementation should the RTT use ?" | ||
When I stop the command started last | ||
Then the exit status should be 0 | ||
Then the output should contain "Command finished successfully" | ||
|
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,35 @@ | ||
Feature: Getting Started | ||
@disable-bundler | ||
@no-clobber | ||
Scenario: Creating the bundle | ||
Given I cd to "dev" | ||
And I successfully run the following script: | ||
"""bash | ||
set -e | ||
source env.sh | ||
acd | ||
cd bundles | ||
syskit init syskit_basics | ||
cd syskit_basics | ||
""" | ||
|
||
When I cd to "bundles/syskit_basics" | ||
And I run the following script in background: | ||
"""bash | ||
set -e | ||
source ../../env.sh | ||
syskit run | ||
""" | ||
Then stdout gets "ready" within 5 seconds | ||
|
||
When I successfully run the following script: | ||
"""bash | ||
set -e | ||
source ../../env.sh | ||
syskit quit | ||
""" | ||
Then the output should contain "closed communication" | ||
|
||
When I stop the command started last | ||
Then the exit status should be 0 | ||
|
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,75 @@ | ||
default_answer_timeout = 5 | ||
|
||
When(/^I run the following (?:commands|script)(?: (?:with|in) `([^`]+)`)? in background:$/) do |shell, commands| | ||
prepend_environment_variable('PATH', expand_path('bin') + File::PATH_SEPARATOR) | ||
|
||
Aruba.platform.mkdir(expand_path('bin')) | ||
shell ||= Aruba.platform.default_shell | ||
|
||
Aruba::ScriptFile.new(:interpreter => shell, :content => commands, | ||
:path => expand_path('bin/myscript')).call | ||
step 'I run `myscript` in background' | ||
end | ||
|
||
When(/^I run the following (?:commands|script)(?: (?:with|in) `([^`]+)`)? interactively:$/) do |shell, commands| | ||
prepend_environment_variable('PATH', expand_path('bin') + File::PATH_SEPARATOR) | ||
|
||
Aruba.platform.mkdir(expand_path('bin')) | ||
shell ||= Aruba.platform.default_shell | ||
|
||
Aruba::ScriptFile.new(:interpreter => shell, :content => commands, | ||
:path => expand_path('bin/myscript')).call | ||
step 'I run `myscript` interactively' | ||
end | ||
|
||
When(/^I successfully run the following (?:commands|script)(?: (?:with|in) `([^`]+)`)?:$/) do |shell, commands| | ||
prepend_environment_variable('PATH', expand_path('bin') + File::PATH_SEPARATOR) | ||
|
||
Aruba.platform.mkdir(expand_path('bin')) | ||
shell ||= Aruba.platform.default_shell | ||
|
||
Aruba::ScriptFile.new(:interpreter => shell, :content => commands, | ||
:path => expand_path('bin/myscript')).call | ||
step "I successfully run `myscript` for up to #{aruba.config.exit_timeout} seconds" | ||
end | ||
|
||
When(/^I answer "([^"]*)" to "([^"]+)"(?: from (\w+))?$/) do |answer, question, channel| | ||
step "I wait for #{channel || 'stdout'} to have \"#{question}\"" | ||
step "I type \"#{answer}\"" | ||
end | ||
|
||
When(/^the default answer timeout is (\d+) seconds$/) do |timeout| | ||
default_answer_timeout = Integer(timeout) | ||
end | ||
|
||
When(/^I wait for (stdout|stderr) to have "([^"]+)"(?: within (\d+) seconds)?$/) do |channel, pattern_string, timeout| | ||
commands = all_commands | ||
if !timeout || timeout == 0 | ||
timeout = default_answer_timeout | ||
end | ||
deadline = Time.now + Integer(timeout) | ||
pattern = Regexp.new(Regexp.quote(pattern_string)) | ||
puts "#{pattern} #{timeout}" | ||
while true | ||
combined_output = commands.map do |c| | ||
c.send(channel.to_sym, wait_for_io: 0).chomp | ||
end.join("\n") | ||
if combined_output =~ pattern | ||
break | ||
elsif commands.all? { |c| c.stopped? } | ||
puts "ALL STOPPED #{commands.map { |c| c.to_s }}" | ||
step "stdout should contain \"#{pattern_string}\"" | ||
elsif Time.now > deadline | ||
raise "timed out (#{timeout} seconds) while waiting for #{combined_output} to contain #{pattern_string}" | ||
end | ||
sleep 0.1 | ||
end | ||
end | ||
|
||
When(/^(stdout|stderr) gets "([^"]+)"(?: within (\d+) seconds)?$/) do |channel, pattern_string, timeout| | ||
if !timeout || timeout == 0 | ||
step "I wait for #{channel} to have \"#{pattern_string}\"" | ||
else | ||
step "I wait for #{channel} to have \"#{pattern_string}\" within #{timeout} seconds" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require 'aruba/cucumber' |