test-prof-autopilot 0.0.3 → 0.0.4
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/test_prof/autopilot/configuration.rb +9 -9
 - data/lib/test_prof/autopilot/logging.rb +1 -1
 - data/lib/test_prof/autopilot/patches/event_prof_patch.rb +1 -1
 - data/lib/test_prof/autopilot/patches/factory_prof_patch.rb +1 -1
 - data/lib/test_prof/autopilot/patches/stack_prof_patch.rb +1 -1
 - data/lib/test_prof/autopilot/profiling_executor/base.rb +2 -2
 - data/lib/test_prof/autopilot/report_builder.rb +1 -1
 - data/lib/test_prof/autopilot/runner.rb +2 -2
 - data/lib/test_prof/autopilot/stack_prof/writer.rb +1 -1
 - data/lib/test_prof/autopilot/version.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: d6b29ef753d35ba43c38480f03c1add33a6b13cbd44af7993a2c832fdc112fab
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: cf9350ecb966825cebcd9c011cfbaddb089b34b8299e038f94b4679eae1a5b8d
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: cf235d7c96b20d9db4f33c31fcddf11112bc6ecf5ad6e305aa7417c034100e27c0b3c14734b7e04a3324ebcbac102deefc2f303fa7ecda6c9bbda5d4c85c86e0
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: ab28bcc384705b84f195fa210cad6d7edf995e8273b8ccbc3acc7a7588cb2dcb8402fdf37bfe2e333bbb0d2fe0c91c7be4552d85095b898138fece8cd1264492
         
     | 
| 
         @@ -2,18 +2,18 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module TestProf
         
     | 
| 
       4 
4 
     | 
    
         
             
              module Autopilot
         
     | 
| 
       5 
     | 
    
         
            -
                 
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
                      @config ||= new
         
     | 
| 
       10 
     | 
    
         
            -
                    end
         
     | 
| 
      
 5 
     | 
    
         
            +
                class << self
         
     | 
| 
      
 6 
     | 
    
         
            +
                  def config
         
     | 
| 
      
 7 
     | 
    
         
            +
                    @config ||= Configuration.new
         
     | 
| 
      
 8 
     | 
    
         
            +
                  end
         
     | 
| 
       11 
9 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
                    end
         
     | 
| 
      
 10 
     | 
    
         
            +
                  def configure
         
     | 
| 
      
 11 
     | 
    
         
            +
                    yield config
         
     | 
| 
       15 
12 
     | 
    
         
             
                  end
         
     | 
| 
      
 13 
     | 
    
         
            +
                end
         
     | 
| 
       16 
14 
     | 
    
         | 
| 
      
 15 
     | 
    
         
            +
                # Global configuration
         
     | 
| 
      
 16 
     | 
    
         
            +
                class Configuration
         
     | 
| 
       17 
17 
     | 
    
         
             
                  attr_accessor :output,
         
     | 
| 
       18 
18 
     | 
    
         
             
                    :tmp_dir,
         
     | 
| 
       19 
19 
     | 
    
         
             
                    :artifacts_dir,
         
     | 
| 
         @@ -36,7 +36,7 @@ module TestProf 
     | 
|
| 
       36 
36 
     | 
    
         
             
                            }
         
     | 
| 
       37 
37 
     | 
    
         
             
                          end
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
     | 
    
         
            -
                          dir_path = FileUtils.mkdir_p( 
     | 
| 
      
 39 
     | 
    
         
            +
                          dir_path = FileUtils.mkdir_p(Autopilot.config.tmp_dir)[0]
         
     | 
| 
       40 
40 
     | 
    
         
             
                          file_path = File.join(dir_path, ARTIFACT_FILE)
         
     | 
| 
       41 
41 
     | 
    
         | 
| 
       42 
42 
     | 
    
         
             
                          File.write(file_path, JSON.generate(profiler_hash))
         
     | 
| 
         @@ -27,7 +27,7 @@ module TestProf 
     | 
|
| 
       27 
27 
     | 
    
         
             
                              }
         
     | 
| 
       28 
28 
     | 
    
         
             
                            end
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
                          dir_path = FileUtils.mkdir_p( 
     | 
| 
      
 30 
     | 
    
         
            +
                          dir_path = FileUtils.mkdir_p(Autopilot.config.tmp_dir)[0]
         
     | 
| 
       31 
31 
     | 
    
         
             
                          file_path = File.join(dir_path, ARTIFACT_FILE)
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
33 
     | 
    
         
             
                          File.write(file_path, JSON.generate(profiler_hash))
         
     | 
| 
         @@ -47,9 +47,9 @@ module TestProf 
     | 
|
| 
       47 
47 
     | 
    
         
             
                    end
         
     | 
| 
       48 
48 
     | 
    
         | 
| 
       49 
49 
     | 
    
         
             
                    def build_command
         
     | 
| 
       50 
     | 
    
         
            -
                      return  
     | 
| 
      
 50 
     | 
    
         
            +
                      return Autopilot.config.command if @options[:paths].nil?
         
     | 
| 
       51 
51 
     | 
    
         | 
| 
       52 
     | 
    
         
            -
                      "#{ 
     | 
| 
      
 52 
     | 
    
         
            +
                      "#{Autopilot.config.command} #{@options[:paths]}"
         
     | 
| 
       53 
53 
     | 
    
         
             
                    end
         
     | 
| 
       54 
54 
     | 
    
         | 
| 
       55 
55 
     | 
    
         
             
                    def build_report
         
     | 
| 
         @@ -15,7 +15,7 @@ module TestProf 
     | 
|
| 
       15 
15 
     | 
    
         
             
                  private
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
                  def fetch_report
         
     | 
| 
       18 
     | 
    
         
            -
                    file_path = File.join( 
     | 
| 
      
 18 
     | 
    
         
            +
                    file_path = File.join(Autopilot.config.tmp_dir, self::ARTIFACT_FILE)
         
     | 
| 
       19 
19 
     | 
    
         
             
                    File.read(file_path)
         
     | 
| 
       20 
20 
     | 
    
         
             
                  rescue Errno::ENOENT => e
         
     | 
| 
       21 
21 
     | 
    
         
             
                    e.message.prepend(ARTIFACT_MISSING_HINT)
         
     | 
| 
         @@ -15,14 +15,14 @@ module TestProf 
     | 
|
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                  class << self
         
     | 
| 
       17 
17 
     | 
    
         
             
                    def invoke(plan_path, command)
         
     | 
| 
       18 
     | 
    
         
            -
                       
     | 
| 
      
 18 
     | 
    
         
            +
                      Autopilot.configure do |config|
         
     | 
| 
       19 
19 
     | 
    
         
             
                        config.plan_path = plan_path
         
     | 
| 
       20 
20 
     | 
    
         
             
                        config.command = command
         
     | 
| 
       21 
21 
     | 
    
         
             
                      end
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         
             
                      Logging.log "Reading #{plan_path}..."
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
       25 
     | 
    
         
            -
                      new.instance_eval(File.read( 
     | 
| 
      
 25 
     | 
    
         
            +
                      new.instance_eval(File.read(Autopilot.config.plan_path))
         
     | 
| 
       26 
26 
     | 
    
         
             
                    end
         
     | 
| 
       27 
27 
     | 
    
         
             
                  end
         
     | 
| 
       28 
28 
     | 
    
         
             
                end
         
     | 
| 
         @@ -10,7 +10,7 @@ module TestProf 
     | 
|
| 
       10 
10 
     | 
    
         
             
                    ARTIFACT_FILE = "stack_prof_report"
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
                    def write_report(report, file_name: ARTIFACT_FILE)
         
     | 
| 
       13 
     | 
    
         
            -
                      dir_path = FileUtils.mkdir_p( 
     | 
| 
      
 13 
     | 
    
         
            +
                      dir_path = FileUtils.mkdir_p(Autopilot.config.artifacts_dir)[0]
         
     | 
| 
       14 
14 
     | 
    
         
             
                      file_path = File.join(dir_path, file_name + ".json")
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                      File.write(file_path, JSON.generate(report.data))
         
     |