itriagetestrail 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/itriagetestrail/version.rb +1 -1
 - data/lib/itriagetestrail.rb +35 -10
 - 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: 50b9d407fc1fdff04e957891ccddddf9d098d53b
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 3c8aff2ff7d2826b9d237008f04a554b0f94accd
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: b88b0237fbab08e7153122745416c51be5bbfaf21538f2361ead1a27ab5c8d0c7ddf16ecb12a35a5308d935a06ddd818c8783e0cbfe41d3ee03ced44e9841fb2
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: a24f9810b8d9900a3fcce1605310a4e131d829af60f727b4294320ee14564eb971f32b3ec53c77aef30cc6c59d1b42c66c828651e5580326ca85de2849542a7d
         
     | 
    
        data/lib/itriagetestrail.rb
    CHANGED
    
    | 
         @@ -15,18 +15,16 @@ module Itriagetestrail 
     | 
|
| 
       15 
15 
     | 
    
         
             
                attr_reader :results
         
     | 
| 
       16 
16 
     | 
    
         
             
                attr_reader :external_results
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
                def initialize(testrail_config 
     | 
| 
      
 18 
     | 
    
         
            +
                def initialize(testrail_config)
         
     | 
| 
       19 
19 
     | 
    
         
             
                  @run_id = 0
         
     | 
| 
       20 
20 
     | 
    
         
             
                  @setup = false
         
     | 
| 
       21 
21 
     | 
    
         
             
                  @testrail_config = testrail_config
         
     | 
| 
       22 
     | 
    
         
            -
                   
     | 
| 
       23 
     | 
    
         
            -
                  @milestone_name = normalize_milestone(origin)
         
     | 
| 
       24 
     | 
    
         
            -
                  @jenkins_build =  
     | 
| 
       25 
     | 
    
         
            -
                  @app_version =  
     | 
| 
      
 22 
     | 
    
         
            +
                  set_project_id
         
     | 
| 
      
 23 
     | 
    
         
            +
                  @milestone_name = normalize_milestone(@testrail_config['origin'])
         
     | 
| 
      
 24 
     | 
    
         
            +
                  @jenkins_build = @testrail_config['jenkinsBuild']
         
     | 
| 
      
 25 
     | 
    
         
            +
                  @app_version = @testrail_config['appVersion']
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
                  if @testrail_config[' 
     | 
| 
       28 
     | 
    
         
            -
                    @execute = true
         
     | 
| 
       29 
     | 
    
         
            -
                  elsif @milestone_name == 'Local'
         
     | 
| 
      
 27 
     | 
    
         
            +
                  if @testrail_config['user'].nil? || @testrail_config['user'] == ''
         
     | 
| 
       30 
28 
     | 
    
         
             
                    @execute = false
         
     | 
| 
       31 
29 
     | 
    
         
             
                  else
         
     | 
| 
       32 
30 
     | 
    
         
             
                    @execute = true
         
     | 
| 
         @@ -44,7 +42,7 @@ module Itriagetestrail 
     | 
|
| 
       44 
42 
     | 
    
         
             
                  @submitted = { results: [] }
         
     | 
| 
       45 
43 
     | 
    
         | 
| 
       46 
44 
     | 
    
         
             
                  @external_results = { results: [] }
         
     | 
| 
       47 
     | 
    
         
            -
                  @batch_size = @testrail_config['batch_size']
         
     | 
| 
      
 45 
     | 
    
         
            +
                  @batch_size = @testrail_config['batch_size'] || 10
         
     | 
| 
       48 
46 
     | 
    
         | 
| 
       49 
47 
     | 
    
         
             
                  make_connection
         
     | 
| 
       50 
48 
     | 
    
         | 
| 
         @@ -93,6 +91,28 @@ module Itriagetestrail 
     | 
|
| 
       93 
91 
     | 
    
         
             
                  end
         
     | 
| 
       94 
92 
     | 
    
         
             
                end
         
     | 
| 
       95 
93 
     | 
    
         | 
| 
      
 94 
     | 
    
         
            +
                def set_project_id()
         
     | 
| 
      
 95 
     | 
    
         
            +
                  requested_id = @testrail_config['projectId']
         
     | 
| 
      
 96 
     | 
    
         
            +
                  case requested_id
         
     | 
| 
      
 97 
     | 
    
         
            +
                  when nil, ''
         
     | 
| 
      
 98 
     | 
    
         
            +
                    # a project id was not provided, fetch it from TestRail by project name
         
     | 
| 
      
 99 
     | 
    
         
            +
                    projects = @client.send_get("get_projects")
         
     | 
| 
      
 100 
     | 
    
         
            +
                    res = -1
         
     | 
| 
      
 101 
     | 
    
         
            +
                    projects.each do |project|
         
     | 
| 
      
 102 
     | 
    
         
            +
                      res = project['id'] if project['name'] == @testrail_config['projectName']
         
     | 
| 
      
 103 
     | 
    
         
            +
                    end
         
     | 
| 
      
 104 
     | 
    
         
            +
                    if res == -1
         
     | 
| 
      
 105 
     | 
    
         
            +
                      puts "TestRail Project Not found for #{@testrail_config['projectName']}"
         
     | 
| 
      
 106 
     | 
    
         
            +
                      @execute = false
         
     | 
| 
      
 107 
     | 
    
         
            +
                      return
         
     | 
| 
      
 108 
     | 
    
         
            +
                    end
         
     | 
| 
      
 109 
     | 
    
         
            +
                    @project_id = res
         
     | 
| 
      
 110 
     | 
    
         
            +
                  else
         
     | 
| 
      
 111 
     | 
    
         
            +
                    # use the requested project id
         
     | 
| 
      
 112 
     | 
    
         
            +
                    @project_id = requested_id
         
     | 
| 
      
 113 
     | 
    
         
            +
                  end
         
     | 
| 
      
 114 
     | 
    
         
            +
                end
         
     | 
| 
      
 115 
     | 
    
         
            +
             
     | 
| 
       96 
116 
     | 
    
         
             
                def fetch_milestone(requested_milestone_name)
         
     | 
| 
       97 
117 
     | 
    
         
             
                  milestones = @client.send_get("get_milestones/#{@project_id}")
         
     | 
| 
       98 
118 
     | 
    
         
             
                  res = -1
         
     | 
| 
         @@ -252,10 +272,15 @@ module Itriagetestrail 
     | 
|
| 
       252 
272 
     | 
    
         
             
                  }
         
     | 
| 
       253 
273 
     | 
    
         
             
                end
         
     | 
| 
       254 
274 
     | 
    
         | 
| 
      
 275 
     | 
    
         
            +
                def closerun?()
         
     | 
| 
      
 276 
     | 
    
         
            +
                  true
         
     | 
| 
      
 277 
     | 
    
         
            +
                  false if @testrail_config['close_run'] == 'false'
         
     | 
| 
      
 278 
     | 
    
         
            +
                end
         
     | 
| 
      
 279 
     | 
    
         
            +
             
     | 
| 
       255 
280 
     | 
    
         
             
                def shutdown
         
     | 
| 
       256 
281 
     | 
    
         
             
                  @pool.shutdown
         
     | 
| 
       257 
282 
     | 
    
         | 
| 
       258 
     | 
    
         
            -
                  @client.send_post("close_run/#{@run_id}", {}) if  
     | 
| 
      
 283 
     | 
    
         
            +
                  @client.send_post("close_run/#{@run_id}", {}) if closerun?
         
     | 
| 
       259 
284 
     | 
    
         
             
                end
         
     | 
| 
       260 
285 
     | 
    
         
             
              end
         
     | 
| 
       261 
286 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: itriagetestrail
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - a801069
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2015-10- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-10-29 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |