fix: Flakiness in CI pipeline (#5562)

- Fixing the recent flakiness in CI pipelines
This commit is contained in:
Sojan Jose 2022-10-05 10:59:31 -07:00 committed by GitHub
parent 7b1630b468
commit 8b0e95ece8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 5 deletions

View file

@ -19,6 +19,7 @@ defaults: &defaults
- COVERAGE: true - COVERAGE: true
- LOG_LEVEL: warn - LOG_LEVEL: warn
parallelism: 4 parallelism: 4
resource_class: large
jobs: jobs:
build: build:
@ -122,9 +123,11 @@ jobs:
mkdir -p coverage mkdir -p coverage
~/tmp/cc-test-reporter before-build ~/tmp/cc-test-reporter before-build
TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
bundle exec rspec --profile 10 \ bundle exec rspec --format progress \
--out test-results/rspec/rspec.xml \ --format RspecJunitFormatter \
--out ~/tmp/test-results/rspec.xml \
-- ${TESTFILES} -- ${TESTFILES}
no_output_timeout: 30m
- run: - run:
name: Code Climate Test Coverage name: Code Climate Test Coverage
command: | command: |
@ -137,7 +140,7 @@ jobs:
~/tmp/cc-test-reporter before-build ~/tmp/cc-test-reporter before-build
TESTFILES=$(circleci tests glob **/specs/*.spec.js | circleci tests split --split-by=timings) TESTFILES=$(circleci tests glob **/specs/*.spec.js | circleci tests split --split-by=timings)
yarn test:coverage --profile 10 \ yarn test:coverage --profile 10 \
--out test-results/frontend_specs/rspec.xml \ --out ~/tmp/test-results/yarn.xml \
-- ${TESTFILES} -- ${TESTFILES}
- run: - run:
name: Code Climate Test Coverage name: Code Climate Test Coverage

View file

@ -174,6 +174,7 @@ group :development, :test do
gem 'listen' gem 'listen'
gem 'mock_redis' gem 'mock_redis'
gem 'pry-rails' gem 'pry-rails'
gem 'rspec_junit_formatter'
gem 'rspec-rails', '~> 5.0.0' gem 'rspec-rails', '~> 5.0.0'
gem 'rubocop', require: false gem 'rubocop', require: false
gem 'rubocop-performance', require: false gem 'rubocop-performance', require: false

View file

@ -536,6 +536,8 @@ GEM
rspec-mocks (~> 3.10) rspec-mocks (~> 3.10)
rspec-support (~> 3.10) rspec-support (~> 3.10)
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.31.2) rubocop (1.31.2)
json (~> 2.3) json (~> 2.3)
parallel (~> 1.10) parallel (~> 1.10)
@ -769,6 +771,7 @@ DEPENDENCIES
responders responders
rest-client rest-client
rspec-rails (~> 5.0.0) rspec-rails (~> 5.0.0)
rspec_junit_formatter
rubocop rubocop
rubocop-performance rubocop-performance
rubocop-rails rubocop-rails
@ -805,4 +808,4 @@ RUBY VERSION
ruby 3.0.4p208 ruby 3.0.4p208
BUNDLED WITH BUNDLED WITH
2.3.17 2.3.18

View file

@ -3,7 +3,7 @@ FactoryBot.define do
account_id { 1 } account_id { 1 }
category_id { 1 } category_id { 1 }
author_id { 1 } author_id { 1 }
title { Faker::Movie.title } title { "#{Faker::Movie.title} #{SecureRandom.hex}" }
content { 'MyText' } content { 'MyText' }
description { 'MyDescrption' } description { 'MyDescrption' }
status { 1 } status { 1 }