From d553381fab1a576e3c29716ae42c8cb31a2e5b8a Mon Sep 17 00:00:00 2001 From: regic Date: Wed, 9 Jun 2021 18:18:10 +0300 Subject: [PATCH 1/5] Try using single VM --- .travis.yml | 49 +++++++++++-------------------------------------- 1 file changed, 11 insertions(+), 38 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27d8f3b..0e1a4c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,41 +15,14 @@ before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build - -# jobs: -# include: -# - stage: test -# script: bundle exec rspec && ./cc-test-reporter format-coverage -t simplecov -o /tmp/coverage/codeclimate.rspec.json -# - stage: test -# script: bundle exec cucumber && ./cc-test-reporter format-coverage -t simplecov -o /tmp/coverage/codeclimate.cucumber.json -# - stage: deploy -# script: ls -alFX /tmp/coverage/ && ls -alFX coverage/ && ./cc-test-reporter sum-coverage /tmp/coverage/codeclimate.*.json -p 2 -o /tmp/coverage/codeclimate.json && ./cc-test-reporter upload-coverage -i "/tmp/coverage/codeclimate.json" - - -jobs: - include: - - stage: test - script: bundle exec rspec && ./cc-test-reporter format-coverage -t simplecov -o codeclimate.rspec.json - workspaces: - create: - name: rspec - paths: . - - stage: test - script: bundle exec cucumber && ./cc-test-reporter format-coverage -t simplecov -o codeclimate.cucumber.json - workspaces: - create: - name: cucumber - paths: . - - stage: codeclimate - git: - clone: false - language: minimal - install: skip - before_script: skip - script: skip - services: skip - workspaces: - use: - - rspec - - cucumber - script: mkdir -p regic/rails5 && cd regic/rails5 && ls -alFX && ./cc-test-reporter sum-coverage codeclimate.*.json -p 2 -o codeclimate.json && ./cc-test-reporter upload-coverage -i codeclimate.json +script: + - bundle exec rspec > rspec.out 2>&1 & + - PID1=$! + - bundle exec cucumber > cucumber.out 2>&1 & + - PID2=$! + - wait $PID1 + - wait $PID2 + - cat rspec.out + - cat cucumber.out +after_script: + - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT From 5d447e43eb473d15309e5119779ab7207843912e Mon Sep 17 00:00:00 2001 From: regic Date: Wed, 9 Jun 2021 18:22:09 +0300 Subject: [PATCH 2/5] Fail RSpec --- spec/success_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/success_spec.rb b/spec/success_spec.rb index e333f5d..8a87646 100644 --- a/spec/success_spec.rb +++ b/spec/success_spec.rb @@ -1,5 +1,5 @@ describe "success" do it "succeeds" do - expect(true).to be true + expect(false).to be true end end From 110318196af0eb2d695e2b6c6154f897d4e1041b Mon Sep 17 00:00:00 2001 From: regic Date: Wed, 9 Jun 2021 19:21:07 +0300 Subject: [PATCH 3/5] Only upload coverage if specs pass --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0e1a4c5..85a550d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,4 +25,5 @@ script: - cat rspec.out - cat cucumber.out after_script: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT + # - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT + - if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi From a63f18cef7cb30b3232a24daafe202e282ed0da2 Mon Sep 17 00:00:00 2001 From: regic Date: Thu, 10 Jun 2021 18:58:26 +0300 Subject: [PATCH 4/5] Try uploading on failure --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 85a550d..86dd988 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,5 +25,5 @@ script: - cat rspec.out - cat cucumber.out after_script: - # - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT - - if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi + - ./cc-test-reporter after-build + # - if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi From 0bdd68e5032be94e786e73257e05e38e8b241791 Mon Sep 17 00:00:00 2001 From: regic Date: Thu, 10 Jun 2021 19:10:31 +0300 Subject: [PATCH 5/5] Add travis_wait for 60 minutes (instead of default 20) Because otherwise travis is stopping after 10 minutes of no input --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 86dd988..03ccb5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,8 @@ script: - PID1=$! - bundle exec cucumber > cucumber.out 2>&1 & - PID2=$! - - wait $PID1 - - wait $PID2 + - travis_wait 60 wait $PID1 + - travis_wait 60 wait $PID2 - cat rspec.out - cat cucumber.out after_script: