Sha256: 02f37e7e44fb3f8dadaa7bf41afc320dbac56b9075e69b324742e7857bbf9152

Contents?: true

Size: 1.32 KB

Versions: 31

Compression:

Stored size: 1.32 KB

Contents

describe HybridPlatformsConductor::TestsRunner do

  context 'when checking global tests execution' do

    # Prepare the test platform with test plugins
    #
    # Parameters::
    # * *platforms_info* (Hash): The platforms 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 = %i[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

31 entries across 31 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.9.5 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.9.4 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.9.2 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.9.1 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.9.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.8.4 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.8.3 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.8.2 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.8.1 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.8.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.7.4 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.7.3 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.7.2 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.7.1 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.7.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.6.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.5.1 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.5.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.4.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb
hybrid_platforms_conductor-33.3.0 spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb