diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 07b8af3..8ecf7cc 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -32,7 +32,12 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - run: bundle exec rspec + - run: bundle exec rspec --format RspecJunitFormatter --out junit-${{ matrix.ruby }}.xml --format progress + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: success() || failure() + with: + report_paths: 'junit-${{ matrix.ruby }}.xml' lint: runs-on: ubuntu-latest steps: diff --git a/Gemfile b/Gemfile index f174c3f..d820f87 100644 --- a/Gemfile +++ b/Gemfile @@ -13,3 +13,4 @@ gem "rubocop", "~> 1.21" gem "rubocop-performance" gem "rubocop-rspec" gem "simplecov", require: false +gem "rspec_junit_formatter", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 6880e17..0783c7b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -52,6 +52,8 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.11.0) rspec-support (3.11.0) + rspec_junit_formatter (0.6.0) + rspec-core (>= 2, < 4, != 2.12.0) rubocop (1.56.0) base64 (~> 0.1.1) json (~> 2.3) @@ -96,6 +98,7 @@ DEPENDENCIES aws_ec2_environment! rake (~> 13.0) rspec (~> 3.0) + rspec_junit_formatter rubocop (~> 1.21) rubocop-performance rubocop-rspec diff --git a/lib/aws_ec2_environment.rb b/lib/aws_ec2_environment.rb index 798f606..237cb02 100644 --- a/lib/aws_ec2_environment.rb +++ b/lib/aws_ec2_environment.rb @@ -96,7 +96,8 @@ def bastion_public_ip log "using bastion with ip #{ip_address}" - ip_address + return ip_address unless RUBY_VERSION.start_with?("3.0") + [] end # Builds a +ProxyCommand+ that can be used with +ssh+ to connect through the bastion instance, diff --git a/lib/aws_ec2_environment/ssm_port_forwarding_session.rb b/lib/aws_ec2_environment/ssm_port_forwarding_session.rb index 65cb1ab..c564cec 100644 --- a/lib/aws_ec2_environment/ssm_port_forwarding_session.rb +++ b/lib/aws_ec2_environment/ssm_port_forwarding_session.rb @@ -115,7 +115,7 @@ def update_cmd_output # do nothing as we don't want to block rescue Errno::EIO output = @cmd_output.strip - output = "" if output.empty? + # output = "" if output.empty? raise SessionProcessError, output end