Sha256: 611234a8da951d47a1b3f422cdaf73a57ddf02e20fc9e3292522dd6dac78efb8

Contents?: true

Size: 1.38 KB

Versions: 36

Compression:

Stored size: 1.38 KB

Contents

module HybridPlatformsConductorTest

  module TestPlugins

    # Test plugin at platform level
    class Platform < HybridPlatformsConductor::Test

      class << self

        # Sequences of platforms on which this test has been run
        # Array< [ Symbol,    String   ] >
        # Array< [ test_name, platform ] >
        attr_accessor :runs

        # List of platforms for which we fail
        # Array<String>
        attr_accessor :fail_for

        # List of platform types that should only be concerned by this test
        # Array<Symbol>
        attr_accessor :only_on_platform_types

        # Eventual sleep time per platform name, per test name
        # Hash<Symbol, Hash<String, Integer> >
        attr_accessor :sleeps

      end

      # Check my_test_plugin.rb.sample documentation for signature details.
      def test_on_platform
        platform_name = @platform.name
        raise 'Failing test' if Platform.fail_for.include? platform_name
        sleep_time = Platform.sleeps.dig(@name, platform_name)
        sleep sleep_time unless sleep_time.nil?
        Platform.runs << [@name, platform_name]
      end

      # Limit the list of platform types for these tests.
      #
      # Result::
      # * Array<Symbol> or nil: List of platform types allowed for this test, or nil for all
      def self.only_on_platforms
        Platform.only_on_platform_types
      end

    end

  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-32.10.0 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.9.1 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.9.0 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.8.2 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.8.1 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.8.0 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.7.3 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.7.2 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.7.1 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.7.0 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.6.0 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.5.0 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.4.2 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.4.1 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.4.0 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
hybrid_platforms_conductor-32.3.6 spec/hybrid_platforms_conductor_test/test_plugins/platform.rb