Skip to content

Commit

Permalink
Updating Cucumber features, added a new one specifically for JDK swit…
Browse files Browse the repository at this point in the history
…ching
  • Loading branch information
michaelklishin committed May 29, 2012
1 parent 00f7ab3 commit f1a3225
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 51 deletions.
74 changes: 74 additions & 0 deletions features/switching_active_jdk.feature
@@ -0,0 +1,74 @@
Feature: Switching JDKs when testing a Clojure project

Scenario: A successful build with OpenJDK 7
Given the following test payload
| repository | travis-ci/travis-ci |
| commit | 1234567 |
| config | language: clojure, env: FOO=foo, jdk: openjdk7 |
When it starts a job
Then it exports the given environment variables
And it successfully clones the repository to the build dir with git
And it successfully checks out the commit with git to the repository directory
And it exports the line TRAVIS_JDK_VERSION=openjdk7
And it successfully switches to the jdk version: openjdk7
And it announces active jdk version
And it announces active leiningen version
And it successfully installs dependencies with lein
And it successfully runs the script: lein test
And it closes the ssh session
And it returns the result 0
And it has captured the following events
| name | data |
| job:test:start | started_at: [now] |
| job:test:log | log: /Using worker/ |
| job:test:log | log: cd ~/builds |
| job:test:log | log: export FOO=foo |
| job:test:log | log: git clone |
| job:test:log | log: cd travis-ci/travis-ci |
| job:test:log | log: git checkout |
| job:test:log | log: /export TRAVIS_JDK_VERSION=openjdk7/ |
| job:test:log | log: sudo jdk_switcher use openjdk7 |
| job:test:log | log: java -version |
| job:test:log | log: javac -version |
| job:test:log | log: lein version |
| job:test:log | log: lein deps |
| job:test:log | log: lein test |
| job:test:log | log: /Done.* 0/ |
| job:test:finish | finished_at: [now], result: 0 |


Scenario: A successful build with Oracle JDK 7
Given the following test payload
| repository | travis-ci/travis-ci |
| commit | 1234567 |
| config | language: clojure, env: FOO=foo, jdk: oraclejdk7 |
When it starts a job
Then it exports the given environment variables
And it successfully clones the repository to the build dir with git
And it successfully checks out the commit with git to the repository directory
And it exports the line TRAVIS_JDK_VERSION=oraclejdk7
And it successfully switches to the jdk version: oraclejdk7
And it announces active jdk version
And it announces active leiningen version
And it successfully installs dependencies with lein
And it successfully runs the script: lein test
And it closes the ssh session
And it returns the result 0
And it has captured the following events
| name | data |
| job:test:start | started_at: [now] |
| job:test:log | log: /Using worker/ |
| job:test:log | log: cd ~/builds |
| job:test:log | log: export FOO=foo |
| job:test:log | log: git clone |
| job:test:log | log: cd travis-ci/travis-ci |
| job:test:log | log: git checkout |
| job:test:log | log: /export TRAVIS_JDK_VERSION=oraclejdk7/ |
| job:test:log | log: sudo jdk_switcher use oraclejdk7 |
| job:test:log | log: java -version |
| job:test:log | log: javac -version |
| job:test:log | log: lein version |
| job:test:log | log: lein deps |
| job:test:log | log: lein test |
| job:test:log | log: /Done.* 0/ |
| job:test:finish | finished_at: [now], result: 0 |
50 changes: 25 additions & 25 deletions features/test_clojure.feature
Expand Up @@ -11,32 +11,32 @@ Feature: Testing a Clojure project
Then it exports the given environment variables
And it successfully clones the repository to the build dir with git
And it successfully checks out the commit with git to the repository directory
And it exports the line TRAVIS_JDK_VERSION=openjdk7
And it successfully switches to the jdk version: openjdk7
And it exports the line TRAVIS_JDK_VERSION=default
And it successfully switches to the jdk version: default
And it announces active jdk version
And it announces active leiningen version
And it successfully installs dependencies with lein
And it successfully runs the script: lein test
And it closes the ssh session
And it returns the result 0
And it has captured the following events
| name | data |
| job:test:start | started_at: [now] |
| job:test:log | log: /Using worker/ |
| job:test:log | log: cd ~/builds |
| job:test:log | log: export FOO=foo |
| job:test:log | log: git clone |
| job:test:log | log: cd travis-ci/travis-ci |
| job:test:log | log: git checkout |
| job:test:log | log: /export TRAVIS_JDK_VERSION=openjdk7/ |
| job:test:log | log: sudo jdk_switcher use openjdk7 |
| job:test:log | log: java -version |
| job:test:log | log: javac -version |
| job:test:log | log: lein version |
| job:test:log | log: lein deps |
| job:test:log | log: lein test |
| job:test:log | log: /Done.* 0/ |
| job:test:finish | finished_at: [now], result: 0 |
| name | data |
| job:test:start | started_at: [now] |
| job:test:log | log: /Using worker/ |
| job:test:log | log: cd ~/builds |
| job:test:log | log: export FOO=foo |
| job:test:log | log: git clone |
| job:test:log | log: cd travis-ci/travis-ci |
| job:test:log | log: git checkout |
| job:test:log | log: /export TRAVIS_JDK_VERSION=default/ |
| job:test:log | log: sudo jdk_switcher use default |
| job:test:log | log: java -version |
| job:test:log | log: javac -version |
| job:test:log | log: lein version |
| job:test:log | log: lein deps |
| job:test:log | log: lein test |
| job:test:log | log: /Done.* 0/ |
| job:test:finish | finished_at: [now], result: 0 |

Scenario: The repository can not be cloned
When it starts a job
Expand All @@ -58,8 +58,8 @@ Feature: Testing a Clojure project
Then it exports the given environment variables
And it successfully clones the repository to the build dir with git
And it successfully checks out the commit with git to the repository directory
And it exports the line TRAVIS_JDK_VERSION=openjdk7
And it successfully switches to the jdk version: openjdk7
And it exports the line TRAVIS_JDK_VERSION=default
And it successfully switches to the jdk version: default
And it announces active jdk version
And it announces active leiningen version
And it fails to install dependencies with lein
Expand All @@ -71,8 +71,8 @@ Feature: Testing a Clojure project
Then it exports the given environment variables
And it successfully clones the repository to the build dir with git
And it successfully checks out the commit with git to the repository directory
And it exports the line TRAVIS_JDK_VERSION=openjdk7
And it fails to switch to the jdk version: openjdk7
And it exports the line TRAVIS_JDK_VERSION=default
And it fails to switch to the jdk version: default
And it closes the ssh session
And it returns the result 1

Expand All @@ -81,8 +81,8 @@ Feature: Testing a Clojure project
Then it exports the given environment variables
And it successfully clones the repository to the build dir with git
And it successfully checks out the commit with git to the repository directory
And it exports the line TRAVIS_JDK_VERSION=openjdk7
And it successfully switches to the jdk version: openjdk7
And it exports the line TRAVIS_JDK_VERSION=default
And it successfully switches to the jdk version: default
And it announces active jdk version
And it announces active leiningen version
And it successfully installs dependencies with lein
Expand Down
52 changes: 26 additions & 26 deletions features/test_scala.feature
Expand Up @@ -11,9 +11,9 @@ Feature: Testing a Scala project
Then it exports the given environment variables
And it successfully clones the repository to the build dir with git
And it successfully checks out the commit with git to the repository directory
And it exports the line TRAVIS_JDK_VERSION=openjdk7
And it exports the line TRAVIS_JDK_VERSION=default
And it exports the line TRAVIS_SCALA_VERSION=2.9.1
And it successfully switches to the jdk version: openjdk7
And it successfully switches to the jdk version: default
And it announces active jdk version
# think ./project
And it finds directory project
Expand All @@ -29,9 +29,9 @@ Feature: Testing a Scala project
| job:test:log | log: git clone |
| job:test:log | log: cd travis-ci/travis-ci |
| job:test:log | log: git checkout |
| job:test:log | log: /export TRAVIS_JDK_VERSION=openjdk7/ |
| job:test:log | log: /export TRAVIS_JDK_VERSION=default/ |
| job:test:log | log: /export TRAVIS_SCALA_VERSION=/ |
| job:test:log | log: sudo jdk_switcher use openjdk7 |
| job:test:log | log: sudo jdk_switcher use default |
| job:test:log | log: java -version |
| job:test:log | log: javac -version |
| job:test:log | log: sbt ++2.9.1 test |
Expand All @@ -43,32 +43,32 @@ Feature: Testing a Scala project
Then it exports the given environment variables
And it successfully clones the repository to the build dir with git
And it successfully checks out the commit with git to the repository directory
And it exports the line TRAVIS_JDK_VERSION=openjdk7
And it exports the line TRAVIS_JDK_VERSION=default
And it exports the line TRAVIS_SCALA_VERSION=2.9.1
And it successfully switches to the jdk version: openjdk7
And it successfully switches to the jdk version: default
And it announces active jdk version
And it does not find directory project
And it finds the file build.sbt
And it successfully runs the script: sbt ++2.9.1 test
And it closes the ssh session
And it returns the result 0
And it has captured the following events
| name | data |
| job:test:start | started_at: [now] |
| job:test:log | log: /Using worker/ |
| job:test:log | log: cd ~/builds |
| job:test:log | log: export FOO=foo |
| job:test:log | log: git clone |
| job:test:log | log: cd travis-ci/travis-ci |
| job:test:log | log: git checkout |
| job:test:log | log: /export TRAVIS_JDK_VERSION=openjdk7/ |
| job:test:log | log: /export TRAVIS_SCALA_VERSION=/ |
| job:test:log | log: sudo jdk_switcher use openjdk7 |
| job:test:log | log: java -version |
| job:test:log | log: javac -version |
| job:test:log | log: sbt ++2.9.1 test |
| job:test:log | log: /Done.* 0/ |
| job:test:finish | finished_at: [now], result: 0 |
| name | data |
| job:test:start | started_at: [now] |
| job:test:log | log: /Using worker/ |
| job:test:log | log: cd ~/builds |
| job:test:log | log: export FOO=foo |
| job:test:log | log: git clone |
| job:test:log | log: cd travis-ci/travis-ci |
| job:test:log | log: git checkout |
| job:test:log | log: /export TRAVIS_JDK_VERSION=default/ |
| job:test:log | log: /export TRAVIS_SCALA_VERSION=/ |
| job:test:log | log: sudo jdk_switcher use default |
| job:test:log | log: java -version |
| job:test:log | log: javac -version |
| job:test:log | log: sbt ++2.9.1 test |
| job:test:log | log: /Done.* 0/ |
| job:test:finish | finished_at: [now], result: 0 |


Scenario: The repository can not be cloned
Expand All @@ -91,9 +91,9 @@ Feature: Testing a Scala project
Then it exports the given environment variables
And it successfully clones the repository to the build dir with git
And it successfully checks out the commit with git to the repository directory
And it exports the line TRAVIS_JDK_VERSION=openjdk7
And it exports the line TRAVIS_JDK_VERSION=default
And it exports the line TRAVIS_SCALA_VERSION=2.9.1
And it fails to switch to the jdk version: openjdk7
And it fails to switch to the jdk version: default
And it closes the ssh session
And it returns the result 1

Expand All @@ -102,9 +102,9 @@ Feature: Testing a Scala project
Then it exports the given environment variables
And it successfully clones the repository to the build dir with git
And it successfully checks out the commit with git to the repository directory
And it exports the line TRAVIS_JDK_VERSION=openjdk7
And it exports the line TRAVIS_JDK_VERSION=default
And it exports the line TRAVIS_SCALA_VERSION=2.9.1
And it successfully switches to the jdk version: openjdk7
And it successfully switches to the jdk version: default
And it announces active jdk version
# think ./project
And it finds directory project
Expand Down

0 comments on commit f1a3225

Please sign in to comment.