omnitest 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.gitmodules +0 -0
- data/.groc.json +7 -0
- data/.rspec +6 -0
- data/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +47 -0
- data/.travis.yml +12 -0
- data/.yardopts +3 -0
- data/Gemfile +26 -0
- data/README.md +341 -0
- data/Rakefile +33 -0
- data/appveyor.yml +9 -0
- data/bin/omnidoc +5 -0
- data/bin/omnitask +5 -0
- data/bin/omnitest +5 -0
- data/bower.json +21 -0
- data/doc-src/index.md.tt +341 -0
- data/doc-src/project_sets.md.tt +31 -0
- data/doc-src/usage/crosstask.md.tt +86 -0
- data/doc-src/usage/omnitest.md.tt +87 -0
- data/features/bootstrapping.feature +25 -0
- data/features/cloning.feature +32 -0
- data/features/fixtures/configs/omnitest_sample.yaml +11 -0
- data/features/fixtures/configs/skeptic_empty.yaml +12 -0
- data/features/fixtures/configs/skeptic_hello_world.yaml +10 -0
- data/features/show.feature +38 -0
- data/features/states.feature +40 -0
- data/features/step_definitions/sdk_steps.rb +22 -0
- data/features/support/env.rb +9 -0
- data/lib/omnitest.rb +211 -0
- data/lib/omnitest/cli.rb +297 -0
- data/lib/omnitest/command.rb +103 -0
- data/lib/omnitest/command/generate.rb +29 -0
- data/lib/omnitest/command/generators/code2doc.rb +79 -0
- data/lib/omnitest/command/generators/dashboard.rb +148 -0
- data/lib/omnitest/command/generators/documentation.rb +119 -0
- data/lib/omnitest/command/list.rb +62 -0
- data/lib/omnitest/command/project_action.rb +26 -0
- data/lib/omnitest/command/scenario_action.rb +20 -0
- data/lib/omnitest/command/show.rb +148 -0
- data/lib/omnitest/command/task.rb +27 -0
- data/lib/omnitest/command/test.rb +41 -0
- data/lib/omnitest/configuration.rb +53 -0
- data/lib/omnitest/documentation_generator.rb +68 -0
- data/lib/omnitest/project.rb +100 -0
- data/lib/omnitest/project_logger.rb +273 -0
- data/lib/omnitest/project_set.rb +47 -0
- data/lib/omnitest/reporters.rb +27 -0
- data/lib/omnitest/reporters/hash_reporter.rb +32 -0
- data/lib/omnitest/reporters/json_reporter.rb +12 -0
- data/lib/omnitest/reporters/markdown_reporter.rb +26 -0
- data/lib/omnitest/reporters/yaml_reporter.rb +12 -0
- data/lib/omnitest/run_action.rb +44 -0
- data/lib/omnitest/version.rb +3 -0
- data/lib/omnitest/workflow.rb +5 -0
- data/mkdocs.yml +8 -0
- data/omnitest.gemspec +39 -0
- data/omnitest.yaml +5 -0
- data/resources/assets/angular/angular.min.js +217 -0
- data/resources/assets/angular/angular.min.js.map +8 -0
- data/resources/assets/angular/json-formatter.min.css +6 -0
- data/resources/assets/angular/json-formatter.min.js +7 -0
- data/resources/assets/angular/ng-table.map +1 -0
- data/resources/assets/angular/ng-table.min.css +3 -0
- data/resources/assets/angular/ng-table.min.js +3 -0
- data/resources/assets/angular/ui-bootstrap-tpls.min.js +10 -0
- data/resources/assets/bootstrap/bootstrap.min.css +9 -0
- data/resources/assets/fonts/glyphicons-halflings-regular.eot +0 -0
- data/resources/assets/fonts/glyphicons-halflings-regular.svg +229 -0
- data/resources/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/resources/assets/fonts/glyphicons-halflings-regular.woff +0 -0
- data/resources/assets/pygments/autumn.css +58 -0
- data/resources/assets/pygments/borland.css +46 -0
- data/resources/assets/pygments/bw.css +34 -0
- data/resources/assets/pygments/colorful.css +61 -0
- data/resources/assets/pygments/default.css +62 -0
- data/resources/assets/pygments/emacs.css +61 -0
- data/resources/assets/pygments/friendly.css +61 -0
- data/resources/assets/pygments/fruity.css +69 -0
- data/resources/assets/pygments/github.css +61 -0
- data/resources/assets/pygments/manni.css +61 -0
- data/resources/assets/pygments/monokai.css +64 -0
- data/resources/assets/pygments/murphy.css +61 -0
- data/resources/assets/pygments/native.css +69 -0
- data/resources/assets/pygments/pastie.css +60 -0
- data/resources/assets/pygments/perldoc.css +58 -0
- data/resources/assets/pygments/tango.css +69 -0
- data/resources/assets/pygments/trac.css +59 -0
- data/resources/assets/pygments/vim.css +69 -0
- data/resources/assets/pygments/vs.css +33 -0
- data/resources/assets/pygments/zenburn.css +1 -0
- data/resources/assets/style.css +56 -0
- data/resources/code_sample.tt +2 -0
- data/resources/generators/dashboard/files/dashboard.html.tt +51 -0
- data/resources/generators/dashboard/files/dashboard.js +26 -0
- data/resources/generators/dashboard/templates/_test_report.html.haml +91 -0
- data/resources/generators/todo/templates/todo.md.tt +6 -0
- data/resources/generators/todo/todo_template.rb +1 -0
- data/samples/.gitignore +2 -0
- data/samples/_markdown.md +5 -0
- data/samples/bootstrap.sh +2 -0
- data/samples/clone.sh +2 -0
- data/samples/code2doc.sh +5 -0
- data/samples/default_bootstrap.rb +7 -0
- data/samples/detect.sh +2 -0
- data/samples/exec.sh +2 -0
- data/samples/omnitest.yaml +24 -0
- data/samples/omnitest_simple.yaml +8 -0
- data/samples/scripts/bootstrap +3 -0
- data/samples/show.sh +4 -0
- data/samples/skeptic.yaml +13 -0
- data/samples/skeptic_simple.yaml +9 -0
- data/samples/test.sh +2 -0
- data/samples/tests/omnitest/validators.rb +23 -0
- data/samples/verify.sh +3 -0
- data/scripts/bootstrap.ps1 +7 -0
- data/scripts/run_script.sh +4 -0
- data/skeptic.yaml +26 -0
- data/spec/fabricators/project_fabricator.rb +19 -0
- data/spec/fabricators/scenario_fabricator.rb +6 -0
- data/spec/fabricators/test_manifest_fabricator.rb +41 -0
- data/spec/fabricators/validator_fabricator.rb +12 -0
- data/spec/fixtures/factorial.py +18 -0
- data/spec/fixtures/omnitest.yaml +11 -0
- data/spec/fixtures/skeptic.yaml +16 -0
- data/spec/fixtures/src-doc/_scenario.md.erb +1 -0
- data/spec/fixtures/src-doc/quine.md.erb +20 -0
- data/spec/omnitest/cli_spec.rb +38 -0
- data/spec/omnitest/configuration_spec.rb +25 -0
- data/spec/omnitest/documentation_generator_spec.rb +59 -0
- data/spec/omnitest/file_finder_spec.rb +21 -0
- data/spec/omnitest/project_spec.rb +65 -0
- data/spec/omnitest_spec.rb +13 -0
- data/spec/spec_helper.rb +32 -0
- data/spec/thor_spy.rb +66 -0
- data/tests/omnitest/bootstrap_validations.rb +7 -0
- data/tests/omnitest/show_validations.rb +22 -0
- data/yard_macros.rb +25 -0
- metadata +470 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 733b6544c62af0c5a7eec226c0baa463e4902b42
|
4
|
+
data.tar.gz: c499172967eb508d76cac14a344ca0f8104b967e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b3a38f1c859246dc8acbb79869eae26b38061c03a90973006ebc4675ce9e00d957d41bc6487b7c355330b91f36201736805cced3ce3af7a4c0ed42ab0324a2f4
|
7
|
+
data.tar.gz: 7a106def7cee5ad18ce4a77214252f96ef91bc517702fa9d0591635bba1f4623ee5ec54cbd3e5bf1f2143a8ff4fcf58d542311426b3110170c03ac5ac6bd87ba
|
data/.gitignore
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Gemfile.lock
|
2
|
+
pacto.log
|
3
|
+
**/.bundle/*.log
|
4
|
+
/reports/
|
5
|
+
.rbenv-vars
|
6
|
+
.packer-creds.json
|
7
|
+
**/tmp/
|
8
|
+
node_modules/
|
9
|
+
.tokens.json
|
10
|
+
/omnitest/
|
11
|
+
pkg/
|
12
|
+
coverage/
|
13
|
+
docs/
|
14
|
+
site/
|
15
|
+
.yardoc/
|
16
|
+
.omnitest/
|
17
|
+
bower_components/
|
18
|
+
samples/sdks/
|
data/.gitmodules
ADDED
File without changes
|
data/.groc.json
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
+
# on 2015-01-13 12:44:42 -0500 using RuboCop version 0.27.0.
|
3
|
+
# The point is for the user to remove these configuration records
|
4
|
+
# one by one as the offenses are removed from the code base.
|
5
|
+
# Note that changes in the inspected code, or installation of new
|
6
|
+
# versions of RuboCop, may require this file to be generated again.
|
7
|
+
|
8
|
+
# Offense count: 2
|
9
|
+
Lint/UselessAssignment:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
# Offense count: 25
|
13
|
+
Metrics/AbcSize:
|
14
|
+
Max: 45
|
15
|
+
|
16
|
+
# Offense count: 1
|
17
|
+
# Configuration parameters: CountComments.
|
18
|
+
Metrics/ClassLength:
|
19
|
+
Max: 118
|
20
|
+
|
21
|
+
# Offense count: 3
|
22
|
+
Metrics/CyclomaticComplexity:
|
23
|
+
Max: 12
|
24
|
+
|
25
|
+
# Offense count: 168
|
26
|
+
# Configuration parameters: AllowURI, URISchemes.
|
27
|
+
Metrics/LineLength:
|
28
|
+
Max: 145
|
29
|
+
|
30
|
+
# Offense count: 35
|
31
|
+
# Configuration parameters: CountComments.
|
32
|
+
Metrics/MethodLength:
|
33
|
+
Max: 35
|
34
|
+
|
35
|
+
# Offense count: 65
|
36
|
+
Style/Documentation:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
# Offense count: 1
|
40
|
+
# Configuration parameters: MinBodyLength.
|
41
|
+
Style/GuardClause:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
# Offense count: 2
|
45
|
+
# Configuration parameters: MaxSlashes.
|
46
|
+
Style/RegexpLiteral:
|
47
|
+
Enabled: false
|
data/.travis.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
language: ruby
|
2
|
+
before_install:
|
3
|
+
# Travis has gradle on the java worker but not the ruby worker
|
4
|
+
- sudo add-apt-repository -y ppa:cwchien/gradle
|
5
|
+
- sudo apt-get update -qq
|
6
|
+
- sudo apt-get install -qq gradle
|
7
|
+
rvm:
|
8
|
+
- 1.9.3
|
9
|
+
- 2.0.0
|
10
|
+
- 2.1.0
|
11
|
+
# - jruby # Not currently supported, because mixlib/shellout doesn't support jruby
|
12
|
+
|
data/.yardopts
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# A sample Gemfile
|
2
|
+
source 'https://rubygems.org'
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'pry'
|
6
|
+
gem 'rake-notes'
|
7
|
+
gem 'simplecov'
|
8
|
+
gem 'metric_fu'
|
9
|
+
gem 'inch'
|
10
|
+
|
11
|
+
# This hack inspired by rspec...
|
12
|
+
branch = begin
|
13
|
+
File.read(File.expand_path('../maintenance-branch', __FILE__)).chomp
|
14
|
+
rescue
|
15
|
+
'master'
|
16
|
+
end
|
17
|
+
|
18
|
+
%w(omnitest-core psychic skeptic).each do |lib|
|
19
|
+
library_path = File.expand_path("../../#{lib}", __FILE__)
|
20
|
+
gem_name = lib.start_with?('omnitest') ? lib : "omnitest-#{lib}"
|
21
|
+
if File.exist?(library_path) && !ENV['USE_GIT_REPOS']
|
22
|
+
gem gem_name, path: library_path
|
23
|
+
else
|
24
|
+
gem gem_name, git: "git://github.com/omnitest/#{lib}.git", branch: branch
|
25
|
+
end
|
26
|
+
end
|
data/README.md
ADDED
@@ -0,0 +1,341 @@
|
|
1
|
+
# Omnitest - the polyglot testing tool
|
2
|
+
|
3
|
+
Omnitest is a tool from running tests and other tasks across a set of related projects. It's a tool for polyglots - the tests and tasks can be written in any language, using any tool. Omnitest may be useful for:
|
4
|
+
- Testing a set of related open-source projects (e.g. a set of plugins for a framework)
|
5
|
+
- Teams working on microservices or other sets of small projects
|
6
|
+
- Testing tools, SDKs or API bindings that have been ported to several programming languages
|
7
|
+
|
8
|
+
Omnitest can be used as a tool to run unrelated tests in each project, but it can also be used to build a compliance suite for projects that
|
9
|
+
are expected to implement the same features, like an SDK that has been ported to multiple programming languages. In those cases corsstest can
|
10
|
+
be used to build a compatibility test suite across the projects, including reports that compare the working features and detected behavior.
|
11
|
+
|
12
|
+
Omnitest was influenced by a number of polyglot projects, including [Travis-CI](travis-ci.org), [Docco](https://github.com/jashkenas/docco), [Slate](https://github.com/tripit/slate), and polyglot test-suites like the [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) and the [JSON-LD Test Suite](http://json-ld.org/test-suite/).
|
13
|
+
|
14
|
+
A lot of the omnitest implementation was influenced by [test-kitchen](http://kitchen.ci/), because in many ways omnitest is attempting to do for cross-project testing what test-kitchen does for cross-platform testing.
|
15
|
+
|
16
|
+
## Overview
|
17
|
+
|
18
|
+
Omnitest provides three main tools that work across projects:
|
19
|
+
- omnitask: Run a task or workflow in every project, even if they each project uses different languages and tools
|
20
|
+
- omnitest: Test code samples in each project against a common set of criteria
|
21
|
+
- omnidoc: Convert annotated code samples to lightweight markup documentation
|
22
|
+
|
23
|
+
## Installing Omnitest
|
24
|
+
|
25
|
+
Omnitest is distributed as a Ruby Gem. It is ideally installed using Bundler by adding this line to your Gemfile:
|
26
|
+
|
27
|
+
```shell
|
28
|
+
gem 'omnitest', '~> 0.1'
|
29
|
+
```
|
30
|
+
|
31
|
+
And then running `bundle install`.
|
32
|
+
|
33
|
+
It can also be installed without Bundler by running `gem install omnitest`.
|
34
|
+
|
35
|
+
**Note**: If installed with bundler it's best to always run `bundle exec omnitest ...` rather than just `omnitest ...`. The bundler documentation explains:
|
36
|
+
|
37
|
+
> In some cases, running executables without `bundle exec` may work, if the executable happens to be installed in your system and does not pull in any gems that conflict with your bundle.
|
38
|
+
>
|
39
|
+
> However, this is unreliable and is the source of considerable pain. Even if it looks like it works, it may not work in the future or on another machine.
|
40
|
+
|
41
|
+
## Defining a project set
|
42
|
+
|
43
|
+
You need to define a set of projects so omnitest can run tasks or tests across them. This is done with a `omnitest.yaml` file. The file defines the
|
44
|
+
name and location of each project, optionally including version control information.
|
45
|
+
|
46
|
+
Here's an example that defines projects named "ruby", "java" and "python":
|
47
|
+
|
48
|
+
```yaml
|
49
|
+
---
|
50
|
+
projects:
|
51
|
+
ruby:
|
52
|
+
language: 'ruby'
|
53
|
+
basedir: 'sdks/ruby'
|
54
|
+
git:
|
55
|
+
repo: 'https://github.com/omnitest/ruby_samples'
|
56
|
+
java:
|
57
|
+
language: 'java'
|
58
|
+
basedir: 'sdks/java'
|
59
|
+
git:
|
60
|
+
repo: 'https://github.com/omnitest/java_samples'
|
61
|
+
python:
|
62
|
+
language: 'python'
|
63
|
+
basedir: 'sdks/python'
|
64
|
+
git:
|
65
|
+
repo: 'https://github.com/omnitest/python_samples'
|
66
|
+
```
|
67
|
+
|
68
|
+
## Getting the projects
|
69
|
+
|
70
|
+
Omnitest needs to have a copy of the project before it can run any tasks or tests. If you already have the projects locally and configured
|
71
|
+
the `basedir` of each project to point to the existing location you can move on to the next step. If you don't have the projects locally but
|
72
|
+
configured the git repo then you can fetch them with the `omnitest clone` command.
|
73
|
+
|
74
|
+
```sh
|
75
|
+
$ bundle exec omnitest clone
|
76
|
+
-----> Starting Omnitest (v0.2.0)
|
77
|
+
Cloning: git clone https://github.com/omnitest/ruby_samples -b master /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/ruby
|
78
|
+
Executing git clone https://github.com/omnitest/ruby_samples -b master /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/ruby
|
79
|
+
Cloning into '/Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/ruby'...
|
80
|
+
Cloning: git clone https://github.com/omnitest/java_samples -b master /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java
|
81
|
+
Executing git clone https://github.com/omnitest/java_samples -b master /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java
|
82
|
+
Cloning into '/Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java'...
|
83
|
+
Cloning: git clone https://github.com/omnitest/python_samples -b master /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/python
|
84
|
+
Executing git clone https://github.com/omnitest/python_samples -b master /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/python
|
85
|
+
Cloning into '/Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/python'...
|
86
|
+
-----> Omnitest is finished. (0m1.12s)
|
87
|
+
```
|
88
|
+
|
89
|
+
### Project groups
|
90
|
+
|
91
|
+
Most omnitest commands accept an argument that specifies to which projects you want to send the command. If omitted then the command is sent to all projects, but you can also specify a single project by name or a regular expression to select projects. You can also specify "all", which is the same behavior as not specifying any argument, but is neccessary if you want to supply additional arguments.
|
92
|
+
|
93
|
+
So in the example above you could use:
|
94
|
+
```sh
|
95
|
+
$ bundle exec omnitest clone ruby
|
96
|
+
# Just clones the ruby projct
|
97
|
+
$ bundle exec omnitest clone "(ruby|java)"
|
98
|
+
# Clones both ruby and java
|
99
|
+
$ bundle exec omnitest clone "*-plugin"
|
100
|
+
# Clones any projects with -plugin in their name
|
101
|
+
```
|
102
|
+
|
103
|
+
Coming soon...
|
104
|
+
|
105
|
+
There will likely be a feature added in the near future to explicitly define groups in the omnitest.yaml file, so that you can select projects based on a group name like "plugins" or "frontend" rather than using a regular expression.
|
106
|
+
|
107
|
+
## Crosstasking (via Psychic)
|
108
|
+
|
109
|
+
Omnitest needs to be able to run tasks in any of the projects before it can run tests. Omnitest uses [psychic](https://github.com/omnitest/psychic), to run tasks. Psychic creates a uniform interface for running similar tasks in different projects, delegating to project specific task runners (like Rake, Make, npm run, or gradle) when necessary.
|
110
|
+
|
111
|
+
The first task you probably want to run is `bootstrap` in order to make sure the projects project is ready to test. Generally the `bootstrap` task will invoke a dependency manager like Bundler, npm, or pip.
|
112
|
+
|
113
|
+
```sh
|
114
|
+
$ bundle exec omnitest bootstrap
|
115
|
+
-----> Starting Omnitest (v0.2.0)
|
116
|
+
-----> Bootstrapping ruby
|
117
|
+
Executing bundle install
|
118
|
+
Resolving dependencies...
|
119
|
+
Your bundle is complete!
|
120
|
+
Use `bundle show [gemname]` to see where a bundled gem is installed.
|
121
|
+
-----> Bootstrapping java
|
122
|
+
Executing mvn clean install
|
123
|
+
:compileJava UP-TO-DATE
|
124
|
+
:processResources UP-TO-DATE
|
125
|
+
:classes UP-TO-DATE
|
126
|
+
:jar
|
127
|
+
:assemble
|
128
|
+
:compileTestJava UP-TO-DATE
|
129
|
+
:processTestResources UP-TO-DATE
|
130
|
+
:testClasses UP-TO-DATE
|
131
|
+
:test UP-TO-DATE
|
132
|
+
:check UP-TO-DATE
|
133
|
+
:build
|
134
|
+
|
135
|
+
BUILD SUCCESSFUL
|
136
|
+
|
137
|
+
Total time: 4.4 secs
|
138
|
+
```
|
139
|
+
|
140
|
+
### Custom tasks
|
141
|
+
|
142
|
+
There are a few default tasks like `bootstrap` that are built into omnitest (and psychic). The default tasks exist to match common test workflows (like the Travis-CI stages or Maven lifecycle), but you can also have omnitest invoke custom tasks.
|
143
|
+
|
144
|
+
So you could tell omnitest to invoke custom tasks like `documentation`, `metrics`, `lint` or `gitstats`:
|
145
|
+
|
146
|
+
```sh
|
147
|
+
$ bundle exec omnitest task lint
|
148
|
+
-----> Starting Omnitest (v0.2.0)
|
149
|
+
-----> Running task lint for ruby
|
150
|
+
Executing bundle exec rubocop -D
|
151
|
+
warning: parser/current is loading parser/ruby21, which recognizes
|
152
|
+
warning: 2.1.5-compliant syntax, but you are running 2.1.4.
|
153
|
+
Inspecting 2 files
|
154
|
+
..
|
155
|
+
|
156
|
+
2 files inspected, no offenses detected
|
157
|
+
-----> Running task lint for java
|
158
|
+
Executing gradle checkstyleMain
|
159
|
+
:compileJava UP-TO-DATE
|
160
|
+
:processResources UP-TO-DATE
|
161
|
+
:classes UP-TO-DATE
|
162
|
+
:checkstyleMain[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/HelloWorld.java:0: Missing package-info.java file.
|
163
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/HelloWorld.java:1: Line is longer than 100 characters (found 101).
|
164
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/HelloWorld.java:3: Missing a Javadoc comment.
|
165
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:1: Missing a Javadoc comment.
|
166
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:2:1: warning: '{' should be on the previous line.
|
167
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:4:3: warning: '{' should be on the previous line.
|
168
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:24: warning: 'for' construct must use '{}'s.
|
169
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:24:8: 'for' is not followed by whitespace.
|
170
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:24:30: warning: ')' is preceded with whitespace.
|
171
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:26: warning: 'for' construct must use '{}'s.
|
172
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:26:8: 'for' is not followed by whitespace.
|
173
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:27:28: warning: '(' is followed by whitespace.
|
174
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:27:54: warning: ')' is preceded with whitespace.
|
175
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:28: warning: 'for' construct must use '{}'s.
|
176
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:28:8: 'for' is not followed by whitespace.
|
177
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:29:28: warning: '(' is followed by whitespace.
|
178
|
+
[ant:checkstyle] /Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/src/main/java/Quine.java:29:33: warning: ')' is preceded with whitespace.
|
179
|
+
FAILED
|
180
|
+
|
181
|
+
FAILURE: Build failed with an exception.
|
182
|
+
|
183
|
+
* What went wrong:
|
184
|
+
Execution failed for task ':checkstyleMain'.
|
185
|
+
> Checkstyle rule violations were found. See the report at: file:///Users/Thoughtworker/repos/rackspace/polytrix/samples/sdks/java/build/reports/checkstyle/main.xml
|
186
|
+
|
187
|
+
* Try:
|
188
|
+
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
|
189
|
+
|
190
|
+
BUILD FAILED
|
191
|
+
|
192
|
+
Total time: 4.904 secs
|
193
|
+
-----> Running task lint for python
|
194
|
+
Executing ./scripts/lint.sh
|
195
|
+
New python executable in omnitest_python/bin/python
|
196
|
+
Installing setuptools, pip...done.
|
197
|
+
katas/hello_world.py:2:22: W292 no newline at end of file
|
198
|
+
katas/quine.py:2:8: E228 missing whitespace around modulo operator
|
199
|
+
-----> Omnitest is finished. (0m8.49s)
|
200
|
+
```
|
201
|
+
|
202
|
+
This is equivalent to running `psychic task lint` in each directory. See [psychic](https://github.com/omnitest/psychic) for more details about how psychic decides what command to invoke for any given task.
|
203
|
+
|
204
|
+
### Workflows
|
205
|
+
|
206
|
+
Coming soon....
|
207
|
+
|
208
|
+
A workflow is a group of tasks that you want to run together on each project.
|
209
|
+
|
210
|
+
The "commit test" workflow is the most common. This is basically a workflow that runs all the tests and checks that should be run before commiting a change. The [Travis-CI lifecycle](http://docs.travis-ci.com/user/build-lifecycle/) and [Maven Lifecycle](http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html) (excluding the "deploy" stage in both cases) are examples.
|
211
|
+
|
212
|
+
Another workflow I've seen is the "morning" workflow. This workflow makes sure each of the projects are ready to start development. This is often similar to a "commit test" workflow, but it will also make sure you have a clean development environment, have fetched the latest upstream changes (from both version control and dependency management systems).
|
213
|
+
|
214
|
+
Another possibility would be a "end of sprint" or "pre-release" workflow. This could be very different than the two examples above. It may focus on collecting metrics or building and publishing release notes.
|
215
|
+
|
216
|
+
## Omnitesting (via Skeptic)
|
217
|
+
|
218
|
+
The `omnitest test` command will run tests in each project, using spies to capture data and validate the behavior. Currently this is used for testing code samples in each project, and omnitest will capture the exit code, stdout and stderr. You can register additional "spies" with skeptic in order to capture additional information or perform additional validation. For example, there are spies that use the [Pacto](https://github.com/thoughtworks/pacto) project to capture HTTP requests and compare them with the RESTful services that were expected to be called for the scenario.
|
219
|
+
|
220
|
+
### Defining test scenarios
|
221
|
+
|
222
|
+
The `suites` section of omnitest.yaml defines the tests you want to run. The suites contain scenarios ("samples") and default properties to use as input while testing the code samples ("global_env" and "env" within suites).
|
223
|
+
|
224
|
+
```yaml
|
225
|
+
global_env: # global_env defines input available for all scenarios
|
226
|
+
LOCALE: <%= ENV['LANG'] %> # templating is allowed
|
227
|
+
suites:
|
228
|
+
Katas: # "Katas" is the name of the first test suite
|
229
|
+
samples: # Test scenarios within Katas
|
230
|
+
- hello world
|
231
|
+
- quine
|
232
|
+
Environment:
|
233
|
+
env: # Unlike global_env, these variables are only for the Katas suite
|
234
|
+
COLOR: red
|
235
|
+
samples:
|
236
|
+
- echo_color
|
237
|
+
```
|
238
|
+
|
239
|
+
### Executing tests
|
240
|
+
|
241
|
+
The command `omnitest test` executes tests. It has two optional arguments:
|
242
|
+
- The first argument selects which projects you want to test, and works exactly the same as described in the omnitasking section.
|
243
|
+
- The second argument selects which scenarios you want to test. This is similar to selecting projects but works on scenarios. You can specify either an exact scenario name, a suite name, or a regular expression.
|
244
|
+
|
245
|
+
So you could run:
|
246
|
+
|
247
|
+
```sh
|
248
|
+
$ bundle exec omnitest test
|
249
|
+
# Tests everything
|
250
|
+
$ bundle exec omnitest test ruby "hello world"
|
251
|
+
# Only tests the "hello world" scenario for the "ruby" project
|
252
|
+
$ bundle exec omnitest test all "quine"
|
253
|
+
# Tests the "quine" scenario in all projects
|
254
|
+
|
255
|
+
### Reports
|
256
|
+
|
257
|
+
The test results are persisted (in the `.omnitest/` folder) so you don't need to run all the tests at once. This way you could test just one project at a time but still get a report showing the results for *all* projects when you're done. This is especially useful if you want to run the tests in parallel on different machines (on a CI server or using Vagrant).
|
258
|
+
|
259
|
+
Omnitest gives you a few different ways to view results.
|
260
|
+
|
261
|
+
#### List
|
262
|
+
|
263
|
+
The `omnitest list` command will give you an overview of the results as table. The default behavior is to display it as a colorized ASCII table, but you can use the `--format` flag to choose additional output formats like YAML or JSON. This is just a quick summary showing the result of testing each scenario:
|
264
|
+
|
265
|
+
```sh
|
266
|
+
$ bundle exec omnitest list
|
267
|
+
Test ID Suite Scenario Project Status
|
268
|
+
katas-hello_world-ruby Katas hello world ruby Partially Verified (1 of 2)
|
269
|
+
katas-hello_world-java Katas hello world java Partially Verified (0 of 2)
|
270
|
+
katas-hello_world-python Katas hello world python Partially Verified (0 of 2)
|
271
|
+
katas-quine-ruby Katas quine ruby <Not Found>
|
272
|
+
katas-quine-java Katas quine java Partially Verified (0 of 2)
|
273
|
+
katas-quine-python Katas quine python Partially Verified (0 of 2)
|
274
|
+
environment-echo_color-ruby Environment echo_color ruby <Not Found>
|
275
|
+
environment-echo_color-java Environment echo_color java <Not Found>
|
276
|
+
environment-echo_color-python Environment echo_color python <Not Found>
|
277
|
+
```
|
278
|
+
|
279
|
+
#### Show
|
280
|
+
|
281
|
+
The `omnitest show` command will display much more detailed results for one or more test scenarios.
|
282
|
+
|
283
|
+
```sh
|
284
|
+
bundle exec omnitest show python "hello world"
|
285
|
+
|
286
|
+
katas-hello_world-python: Partially Verified (0 of 2)
|
287
|
+
Test suite: Katas
|
288
|
+
Test scenario: hello world
|
289
|
+
Project: python
|
290
|
+
Source: sdks/python/katas/hello_world.py
|
291
|
+
Execution result:
|
292
|
+
Exit Status: 0
|
293
|
+
Stdout:
|
294
|
+
Stderr:
|
295
|
+
Validations:
|
296
|
+
Hello world validator: x Failed
|
297
|
+
Error message:
|
298
|
+
expected: "Hello, world!\n"
|
299
|
+
got: ""
|
300
|
+
|
301
|
+
(compared using ==)
|
302
|
+
|
303
|
+
Diff:
|
304
|
+
@@ -1,2 +1 @@
|
305
|
+
-Hello, world!
|
306
|
+
|
307
|
+
default validator: x Failed
|
308
|
+
Error message: expected "" to end with "\n"
|
309
|
+
Data from spies:
|
310
|
+
```
|
311
|
+
|
312
|
+
#### Dashboard
|
313
|
+
|
314
|
+
The command `omnitest generate dashboard` will an HTML dashboard with several reports. The default dashboard is described below, but the dashboard is built withtemplate can be customized and extended by writing a [Thor generator](https://github.com/erikhuda/thor/wiki/Generators).
|
315
|
+
|
316
|
+
The default dashboard will produce a "feature matrix" that is similar to the `omnitest list` command, but is sortable/filterable and where each result is linked to a detailed report that's similar to the `omnitest show` command.
|
317
|
+
|
318
|
+
### Crossdoc
|
319
|
+
|
320
|
+
The `omnidoc` command converts annotated sample code (possibly code tested with omnitest) to documentation. It's like a cross between [docco](http://jashkenas.github.io/docco/) and [pandoc](http://johnmacfarlane.net/pandoc/).
|
321
|
+
|
322
|
+
Now that the projects are defined you need to fetch the code before you can run any tasks or tests on the projects. If you already have
|
323
|
+
|
324
|
+
Once hte set of
|
325
|
+
In order to be able run tests in any project we first need to be able to run tasks in any project.
|
326
|
+
|
327
|
+
### Other features
|
328
|
+
|
329
|
+
There are other commands available in the omnitest suite of tests. Many of them are to subdivide `omnitest test` into phases so you can
|
330
|
+
partially test something (useful while developing tests). That includes:
|
331
|
+
|
332
|
+
```sh
|
333
|
+
Commands:
|
334
|
+
omnitest bootstrap [PROJECT|REGEXP|all] [SCENARIO|REGEXP|all] # Change scenario state to bootstraped. Running bootstrap scripts for the project
|
335
|
+
omnitest detect [PROJECT|REGEXP|all] [SCENARIO|REGEXP|all] # Find sample code that matches a test scenario. Attempts to locate a code sample with a filename that the test scenario name.
|
336
|
+
omnitest exec [PROJECT|REGEXP|all] [SCENARIO|REGEXP|all] # Change instance state to executed. Execute the code sample and capture the results.
|
337
|
+
|
338
|
+
#### Clean
|
339
|
+
|
340
|
+
You can use the `omnitest clean` command to remove results that have been persisted.
|
341
|
+
|