capistrano-ghostinspector 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +23 -1
- data/lib/capistrano/ghostinspector.rb +6 -2
- data/lib/capistrano/ghostinspector/arrays.rb +14 -1
- data/lib/capistrano/ghostinspector/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cb57e45bdf46b7b97c9eea05c7f759f15ee3c61
|
4
|
+
data.tar.gz: 208f35347e5574e54ca43dcfe68289cac16cda58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a874e0d9a8347d598f9fe6e48afc3606de07b122482abb1ebb8595dd09cff458cc8ff84b3adce199e450a120b36c6853f66a9fe10661b75c1e3c16772fbb0e5
|
7
|
+
data.tar.gz: 2885207ca074c23ac60a3086568cf53502834a796658ef9dfb86c419f086daa1869f2e8dd8deaf43a2cae9a1578b2ee933da87219102b840aa087b6711ccccd5
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Capistrano::Ghostinspector
|
2
2
|
|
3
|
-
[![Scrutinizer Code Quality](https://
|
3
|
+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/richdynamix/capistrano-ghostinspector/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/richdynamix/capistrano-ghostinspector/?branch=develop)
|
4
|
+
[![Build Status](https://scrutinizer-ci.com/g/richdynamix/capistrano-ghostinspector/badges/build.png?b=develop)](https://scrutinizer-ci.com/g/richdynamix/capistrano-ghostinspector/build-status/develop) [![Gem Version](https://badge.fury.io/rb/capistrano-ghostinspector.svg)](https://badge.fury.io/rb/capistrano-ghostinspector)
|
4
5
|
|
5
6
|
|
6
7
|
[Ghost Inspector](https://ghostinspector.com/ "Ghost Inspector") is an automated website regression testing tool. This [Capistrano](http://capistranorb.com/ "Capistrano") plugin is a simple, configurable gem that will provide the following features.
|
@@ -77,6 +78,8 @@ By default the `rollback` feature is enabled, you can disabled this for all stag
|
|
77
78
|
set :rollback, false
|
78
79
|
```
|
79
80
|
|
81
|
+
## Google Analytics Tracking
|
82
|
+
|
80
83
|
The Google Analytics property must be inserted into the `ga_property` in order to log deployments and errors. Simply update your YAML to include this `ga_property: "UA-XXXXXXXX-1"`. To disable the Google Analytics tracking just leave the `ga_property` as empty string i.e. `ga_property: ""` in your YAML.
|
81
84
|
|
82
85
|
Since version `0.3.0`, Google Analytics now uses Custom Dimensions as outlined in the [Google Measurement Protocol](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters?hl=en#cd_ "Google Measurement Protocol") documentation. When you define a new custom dimension in Google Analytics you are given a new dimension index. Default accounts have 20 available indexes where as premium accounts have 200. The `ga_custom_1` property is used to define the custom dimension for the testname and `ga_custom_2` is used to define the Jira tickets*. If you do not set the `ga_custom_1` or `ga_custom_2` properties then the default index of `1` & `2` will be used.
|
@@ -107,6 +110,19 @@ Run a multiple suites when deploying to staging -
|
|
107
110
|
|
108
111
|
$ cap staging deploy -s gisuite=aboutpage,suite2
|
109
112
|
|
113
|
+
#### Run Default Tests
|
114
|
+
|
115
|
+
Since version `0.4.0`you can now set your default tests/suites to run in each stage. e.g. you might want to run a certain test suite in `production` only but have other tests running in `staging`. You can now set this in your `stage.rb` file using two new flags.
|
116
|
+
|
117
|
+
i.e `production.rb` might look like this -
|
118
|
+
```ruby
|
119
|
+
set :gi_default_suite, "home"
|
120
|
+
```
|
121
|
+
and your `staging.rb` file might have the following -
|
122
|
+
```ruby
|
123
|
+
set :gi_default_test, "blog,checkout"
|
124
|
+
```
|
125
|
+
As you can see the two new variables `gi_default_suite` and `gi_default_test` can also take a comma separated list to run.
|
110
126
|
|
111
127
|
## Contributing
|
112
128
|
|
@@ -115,3 +131,9 @@ Run a multiple suites when deploying to staging -
|
|
115
131
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
116
132
|
4. Push to the branch (`git push origin my-new-feature`)
|
117
133
|
5. Create a new Pull Request
|
134
|
+
|
135
|
+
## Credits
|
136
|
+
|
137
|
+
* Bhalin Ramabhadran - https://twitter.com/BhalinR
|
138
|
+
* Grant Kemp - https://twitter.com/ukandroid
|
139
|
+
* Steven Richardson - https://twitter.com/troongizmo
|
@@ -45,6 +45,10 @@ module Capistrano
|
|
45
45
|
set :gitest, fetch(:gitest, nil)
|
46
46
|
set :gisuite, fetch(:gisuite, nil)
|
47
47
|
|
48
|
+
# Get any default tests that have been set on the stage
|
49
|
+
set :gi_default_test, fetch(:gi_default_test, nil)
|
50
|
+
set :gi_default_suite, fetch(:gi_default_suite, nil)
|
51
|
+
|
48
52
|
# Check if GI is enabled for this deployment (Default: true)
|
49
53
|
set :gi_enabled, fetch(:gi_enabled, gi_config['gi_enabled'])
|
50
54
|
|
@@ -61,7 +65,7 @@ module Capistrano
|
|
61
65
|
|
62
66
|
@collection = Array.new
|
63
67
|
# run each test
|
64
|
-
Capistrano::Ghostinspector.getTests(fetch(:gitest), gi_config["tests"]).each do |test|
|
68
|
+
Capistrano::Ghostinspector.getTests(fetch(:gitest), gi_config["tests"], fetch(:gi_default_test)).each do |test|
|
65
69
|
puts "* * * Running Ghost Inspector Test * * *"
|
66
70
|
set :data, giApi.executeApi("tests", test)
|
67
71
|
|
@@ -70,7 +74,7 @@ module Capistrano
|
|
70
74
|
end
|
71
75
|
|
72
76
|
# run each suite
|
73
|
-
Capistrano::Ghostinspector.getTests(fetch(:gisuite), gi_config["suites"]).each do |suite|
|
77
|
+
Capistrano::Ghostinspector.getTests(fetch(:gisuite), gi_config["suites"], fetch(:gi_default_suite)).each do |suite|
|
74
78
|
puts "* * * Running Ghost Inspector Suite * * *"
|
75
79
|
set :data, giApi.executeApi("suites", suite)
|
76
80
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Capistrano
|
2
2
|
module Ghostinspector
|
3
|
-
def self.getTests(test, giconfig)
|
3
|
+
def self.getTests(test, giconfig, default)
|
4
4
|
|
5
5
|
# Return an array of tests/suites to
|
6
6
|
# run in ghost inspector
|
@@ -13,6 +13,19 @@ module Capistrano
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
# add any default tests or suites set by the stage
|
17
|
+
if (default != nil)
|
18
|
+
default.split(',').each do |key|
|
19
|
+
if (giconfig.has_key?(key))
|
20
|
+
if(array.include?(giconfig[key]))
|
21
|
+
# do nothing, it already exists
|
22
|
+
else
|
23
|
+
array << giconfig[key]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
16
29
|
return array
|
17
30
|
|
18
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-ghostinspector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Richardson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|