Skip to content

Commit

Permalink
replace codeclimate with codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
franknowinski committed Oct 22, 2024
1 parent 8781f83 commit ddb8a80
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 50 deletions.
45 changes: 6 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
version: 2.1

orbs:
codecov: codecov/codecov@4.0.1

references:
default_docker_ruby_executor: &default_docker_ruby_executor
image: cimg/ruby:3.3.0
Expand Down Expand Up @@ -51,11 +55,6 @@ jobs:
command: |
gem install bundler
bundle check || bundle install
- run:
name: Install Code Climate Test Reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- run: sudo apt -y update; sudo apt install -y postgresql-client
- run:
name: Install postgresql-client
Expand All @@ -71,41 +70,12 @@ jobs:
name: Run RSpec (headless)
command: |
mkdir /tmp/test-results
./cc-test-reporter before-build
TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
bundle exec rspec $TESTFILES --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
- run:
name: Code Climate Test Coverage
command: |
./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
- persist_to_workspace:
root: coverage
paths:
- codeclimate.*.json
- store_test_results:
path: /tmp/test-results
- codecov/upload
- store_artifacts:
path: /tmp/test-results
destination: test-results
path: coverage

upload-coverage:
working_directory: ~/land/land_index
docker:
- *default_docker_ruby_executor
environment:
CC_TEST_REPORTER_ID: 6aa31a8c5421bb710854bc69f9a7d8d48492125de2a76ebdbc50f6167d9cc748
steps:
- attach_workspace:
at: ~/land/land_index
- run:
name: Install Code Climate Test Reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- run:
name: Combine and Upload Coverage
command: |
./cc-test-reporter sum-coverage --output - codeclimate.*.json | ./cc-test-reporter upload-coverage --debug --input -
workflows:
version: 2.1
build_and_test:
Expand All @@ -114,6 +84,3 @@ workflows:
- test:
requires:
- build
- upload-coverage:
requires:
- test
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Land
[![codecov](https://codecov.io/gh/Beyond-Finance/land/graph/badge.svg?token=D2L5P2D9AI)](https://codecov.io/gh/Beyond-Finance/land)

Land is a clickstream tracker for Rails applications. It will track visits, pageviews, marketing attribution and more.

## Installation
Expand Down
6 changes: 0 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ else
task default: :spec
end

# Clean up some clutter in `rake -T`.
%w[
app:template
app:update
].each { |name| Rake::Task[name].clear }

%w[
clean
clobber_rdoc
Expand Down
5 changes: 0 additions & 5 deletions app/.codeclimate

This file was deleted.

1 change: 1 addition & 0 deletions land.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ Gem::Specification.new do |gem|
gem.add_development_dependency "rspec_junit_formatter"
gem.add_development_dependency "rspec-rails"
gem.add_development_dependency 'simplecov', '< 0.18'
gem.add_development_dependency 'simplecov-cobertura'
end
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@

require 'bundler/setup'
require 'simplecov'
require 'simplecov-cobertura'

SimpleCov.minimum_coverage 86
SimpleCov.start 'rails' do
add_filter '/spec'
# rails-generated superclass files
add_filter '/app/jobs/application_job.rb'
add_filter '/app/models/application_record.rb'

formatter SimpleCov::Formatter::CoberturaFormatter
end

RSpec.configure do |config|
Expand Down

0 comments on commit ddb8a80

Please sign in to comment.