Sha256: 6c47ec68675a56aa2b48e33f71674eef832c235bb39e34b44afea5f625309943

Contents?: true

Size: 1.3 KB

Versions: 34

Compression:

Stored size: 1.3 KB

Contents

describe HybridPlatformsConductor::TestsRunner do

  context 'checking global tests execution' do

    # Prepare the test platform with test plugins
    #
    # Parameters::
    # * *platforms_info* (Hash): The platofrms info [default: {}]
    def with_test_platform_for_global_tests(platforms_info: {})
      with_test_platform(platforms_info) do
        register_test_plugins(test_tests_runner,
          global_test: HybridPlatformsConductorTest::TestPlugins::Global,
          global_test_2: HybridPlatformsConductorTest::TestPlugins::Global
        )
        yield
      end
    end

    it 'executes 1 global test only once even if there are several nodes' do
      with_test_platform_for_global_tests(platforms_info: { nodes: { 'node1' => {}, 'node2' => {}, 'node3' => {} } }) do
        test_tests_runner.tests = [:global_test]
        expect(test_tests_runner.run_tests(%w[node1 node2 node3])).to eq 0
        expect(HybridPlatformsConductorTest::TestPlugins::Global.nbr_runs).to eq 1
      end
    end

    it 'executes several global tests' do
      with_test_platform_for_global_tests do
        test_tests_runner.tests = [:global_test, :global_test_2]
        expect(test_tests_runner.run_tests([])).to eq 0
        expect(HybridPlatformsConductorTest::TestPlugins::Global.nbr_runs).to eq 2
      end
    end

  end

end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-32.17.1 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.17.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.16.4 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.16.3 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.16.2 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.16.1 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.16.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.15.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.14.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.13.4 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.13.3 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.13.2 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.13.1 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.13.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.12.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.11.2 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.11.1 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.11.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.10.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-32.9.1 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb