File tree Expand file tree Collapse file tree 3 files changed +26
-4
lines changed
Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 1111- [x] Static status comments on all the scenarios
1212- [x] Support for RSpec ` shared examples `
1313- [x] Disable ` testrail-rspec ` execution on-demand
14+ - [x] Support for environment variables to pass testrail config values
1415
1516## Installation
1617
152153 ` ` `
153154 Set, `clean_testrun : false` if you don't want to clean the existing test runs; but this keyword is optional.
154155
155- 6. To skip specific test-runs from deletion, when `clean_testrun` is set `true `
156+ 6. Skip specific test-runs from deletion : set `clean_testrun: true` & `skip_testrun_ids: value, ... `
156157 ` ` ` yaml
157158 testrail:
158159 url: https://your_url.testrail.io/
165166 ` ` `
166167 Here, `skip_testrun_ids : value` is optional.
167168
168- 7. To disable `testrail-rspec` execution
169+ 7. Disable `testrail-rspec` execution : set `allow: yes`
169170 ` ` ` yaml
170171 testrail:
171172 url: https://your_url.testrail.io/
174175 run_id: 111
175176 allow: no
176177 ` ` `
177- Here, `skip_testrun_ids : value` is optional.
178+ Here, `allow : yes` is optional.
179+
180+ 8. Use Environment variables to pass testrail config values
181+ ` ` ` yaml
182+ testrail:
183+ url: ENV['URL']
184+ user: ENV['TESTRAIL_USER']
185+ password: ENV['TESTRAIL_PASSWORD']
186+ run_id: ENV['RUN_ID']
187+ clean_testrun: false
188+ project_id: 10
189+ suite_id: 110
190+ ` ` `
191+ Example, `rake ./demo_spec.rb TESTRAIL_USER=your@email.com TESTRAIL_PASSWORD=****** RUN_ID=564 URL=https://your_url.testrail.io/`
178192
179193# ### Hooks
180194
Original file line number Diff line number Diff line change @@ -9,6 +9,14 @@ def initialize(scenario)
99
1010 if File . exist? './testrail_config.yml'
1111 @config = YAML . load_file ( "./testrail_config.yml" ) [ 'testrail' ]
12+
13+ @config = @config . transform_values do |e |
14+ if e . class != Integer && e . to_s . include? ( 'ENV[' )
15+ eval ( e )
16+ else
17+ e
18+ end
19+ end
1220 raise 'TestRail configuration file not loaded successfully' if @config . nil?
1321 else
1422 raise 'TestRail configuration file is required'
Original file line number Diff line number Diff line change 11module TestrailRspec
2- VERSION = '0.1.8 ' . freeze
2+ VERSION = '0.1.9 ' . freeze
33end
You can’t perform that action at this time.
0 commit comments