Skip to content
Snippets Groups Projects
Select Git revision
  • 429c56e9b940e03f0b24ecb93540961fd450737b
  • master default protected
2 results

Rakefile

Blame
    • Imran Iqbal's avatar
      ead2d21b
      fix(rubocop): fix (or exclude) all violations · ead2d21b
      Imran Iqbal authored
      ```bash
      tomcat-formula$ rubocop -d
      
      Offenses:
      
      Rakefile:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment.
      require 'rake'
      ^
      Rakefile:31:4: C: Layout/TrailingEmptyLines: Final newline missing.
      end
      
      test/integration/tomcat_extend/serverspec/tomcat_extend_spec.rb:791:1: E: Lint/Syntax: unexpected token $end
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
      test/integration/tomcat_install/controls/yaml_dump_spec.rb:175:79: C: Style/FormatStringToken: Prefer annotated tokens (like %<foo>s) over template tokens (like %{foo}).
                    pattern: '%h %l %u %t &quot;%m http://%v%U %H&quot; %s %b &quot;%{Referer}i&quot;
                                                                                    ^^^^^^^^^^
      test/integration/tomcat_install/controls/yaml_dump_spec.rb:348:79: C: Style/FormatStringToken: Prefer annotated tokens (like %<foo>s) over template tokens (like %{foo}).
                    pattern: '%h %l %u %t &quot;%m http://%v%U %H&quot; %s %b &quot;%{Referer}i&quot;
                                                                                    ^^^^^^^^^^
      test/integration/tomcat_install/controls/yaml_dump_spec.rb:521:79: C: Style/FormatStringToken: Prefer annotated tokens (like %<foo>s) over template tokens (like %{foo}).
                    pattern: '%h %l %u %t &quot;%m http://%v%U %H&quot; %s %b &quot;%{Referer}i&quot;
                                                                                    ^^^^^^^^^^
      test/integration/tomcat_install/serverspec/install_spec.rb:11:20: E: Lint/Syntax: unexpected token tCOLON
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
          service_running: False
                         ^
      test/integration/tomcat_install/serverspec/install_spec.rb:19:20: E: Lint/Syntax: unexpected token tCOLON
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
          service_running: False
                         ^
      test/integration/tomcat_install/serverspec/install_spec.rb:26:20: E: Lint/Syntax: unexpected token tCOLON
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
          service_running: False
                         ^
      test/integration/tomcat_install/serverspec/install_spec.rb:35:22: E: Lint/Syntax: unexpected token tCOLON
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
            service_running: False
                           ^
      test/integration/tomcat_install/serverspec/install_spec.rb:42:22: E: Lint/Syntax: unexpected token tCOLON
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
            service_running: False
                           ^
      test/integration/tomcat_install/serverspec/install_spec.rb:49:22: E: Lint/Syntax: unexpected token tCOLON
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
            service_running: False
                           ^
      test/integration/tomcat_install/serverspec/install_spec.rb:77:1: E: Lint/Syntax: unexpected token kEND
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
      end
      ^^^
      test/integration/tomcat_install/serverspec/install_spec.rb:187:5: E: Lint/Syntax: unexpected token kWHEN
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
          when '18.04'
          ^^^^
      test/shared/spec_helper.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment.
      require "serverspec"
      ^
      test/shared/spec_helper.rb:1:9: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
      require "serverspec"
              ^^^^^^^^^^^^
      test/shared/spec_helper.rb:2:9: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
      require "pathname"
              ^^^^^^^^^^
      test/shared/spec_helper.rb:8:12: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
        c.path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      
      9 files inspected, 18 offenses detected
      ```
      fix(rubocop): fix (or exclude) all violations
      Imran Iqbal authored
      ```bash
      tomcat-formula$ rubocop -d
      
      Offenses:
      
      Rakefile:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment.
      require 'rake'
      ^
      Rakefile:31:4: C: Layout/TrailingEmptyLines: Final newline missing.
      end
      
      test/integration/tomcat_extend/serverspec/tomcat_extend_spec.rb:791:1: E: Lint/Syntax: unexpected token $end
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
      test/integration/tomcat_install/controls/yaml_dump_spec.rb:175:79: C: Style/FormatStringToken: Prefer annotated tokens (like %<foo>s) over template tokens (like %{foo}).
                    pattern: '%h %l %u %t &quot;%m http://%v%U %H&quot; %s %b &quot;%{Referer}i&quot;
                                                                                    ^^^^^^^^^^
      test/integration/tomcat_install/controls/yaml_dump_spec.rb:348:79: C: Style/FormatStringToken: Prefer annotated tokens (like %<foo>s) over template tokens (like %{foo}).
                    pattern: '%h %l %u %t &quot;%m http://%v%U %H&quot; %s %b &quot;%{Referer}i&quot;
                                                                                    ^^^^^^^^^^
      test/integration/tomcat_install/controls/yaml_dump_spec.rb:521:79: C: Style/FormatStringToken: Prefer annotated tokens (like %<foo>s) over template tokens (like %{foo}).
                    pattern: '%h %l %u %t &quot;%m http://%v%U %H&quot; %s %b &quot;%{Referer}i&quot;
                                                                                    ^^^^^^^^^^
      test/integration/tomcat_install/serverspec/install_spec.rb:11:20: E: Lint/Syntax: unexpected token tCOLON
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
          service_running: False
                         ^
      test/integration/tomcat_install/serverspec/install_spec.rb:19:20: E: Lint/Syntax: unexpected token tCOLON
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
          service_running: False
                         ^
      test/integration/tomcat_install/serverspec/install_spec.rb:26:20: E: Lint/Syntax: unexpected token tCOLON
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
          service_running: False
                         ^
      test/integration/tomcat_install/serverspec/install_spec.rb:35:22: E: Lint/Syntax: unexpected token tCOLON
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
            service_running: False
                           ^
      test/integration/tomcat_install/serverspec/install_spec.rb:42:22: E: Lint/Syntax: unexpected token tCOLON
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
            service_running: False
                           ^
      test/integration/tomcat_install/serverspec/install_spec.rb:49:22: E: Lint/Syntax: unexpected token tCOLON
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
            service_running: False
                           ^
      test/integration/tomcat_install/serverspec/install_spec.rb:77:1: E: Lint/Syntax: unexpected token kEND
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
      end
      ^^^
      test/integration/tomcat_install/serverspec/install_spec.rb:187:5: E: Lint/Syntax: unexpected token kWHEN
      (Using Ruby 2.7 parser; configure using TargetRubyVersion parameter, under AllCops)
          when '18.04'
          ^^^^
      test/shared/spec_helper.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment.
      require "serverspec"
      ^
      test/shared/spec_helper.rb:1:9: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
      require "serverspec"
              ^^^^^^^^^^^^
      test/shared/spec_helper.rb:2:9: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
      require "pathname"
              ^^^^^^^^^^
      test/shared/spec_helper.rb:8:12: C: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
        c.path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      
      9 files inspected, 18 offenses detected
      ```
    Rakefile 776 B
    # frozen_string_literal: true
    
    require 'rake'
    require 'rake/testtask'
    require 'bundler/setup'
    
    Rake::TestTask.new do |t|
      t.libs << 'lib'
      t.pattern = 'test/**/*_test.rb'
      t.verbose = false
    end
    
    desc 'Run Test Kitchen integration tests'
    namespace :integration do
      desc 'Run integration tests with kitchen-docker'
      task :docker do
        require 'kitchen'
        Kitchen.logger = Kitchen.default_file_logger
        @loader = Kitchen::Loader::YAML.new(local_config: '.kitchen.docker.yml')
        Kitchen::Config.new(loader: @loader).instances.each do |instance|
          instance.test(:always)
        end
      end
    end
    
    task default: :test
    
    begin
      require 'kitchen/rake_tasks'
      Kitchen::RakeTasks.new
    rescue LoadError
      puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
    end