From e04c852c2e09faffba4ee2a2e8e8276b08372fd4 Mon Sep 17 00:00:00 2001 From: Chris Preisinger Date: Mon, 1 Jul 2024 20:42:18 -0400 Subject: [PATCH] 6 Add basic circleci config for running tests --- .circleci/config.yml | 40 +++++++++++++++++++++++++++++++++++++ Gemfile | 2 ++ Gemfile.lock | 47 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..17efdc3b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,40 @@ +version: 2.1 + +orbs: + ruby: circleci/ruby@2.1.3 + docker: circleci/docker@2.6.0 + +executors: + test_executor: + working_directory: ~/Challenge_platform + docker: + - image: cimg/ruby:3.2.2 + environment: + RAILS_ENV: test + +jobs: + rspec: + executor: + name: test_executor + steps: + - checkout + - run: gem install bundler --version 2.4.13 + - restore_cache: + keys: + - bundle-cache-v1-{{ checksum "Gemfile.lock" }} + - bundle-cache-v1- + - run: + name: Install dependencies + command: bundle install --path vendor/bundle + - save_cache: + key: bundle-cache-v1-{{ checksum "Gemfile.lock" }} + paths: + - vendor/bundle + - run: + name: Run Tests + command: bundle exec rspec + +workflows: + build_and_test: + jobs: + - rspec diff --git a/Gemfile b/Gemfile index e5e2fc56..933d2add 100644 --- a/Gemfile +++ b/Gemfile @@ -47,6 +47,8 @@ gem "bootsnap", require: false group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem gem "debug", platforms: %i[ mri windows ] + + gem "rspec-rails" end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 38142e6c..d51f7959 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -77,6 +77,7 @@ GEM tzinfo (~> 2.0) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) + ast (2.4.2) base64 (0.2.0) bigdecimal (3.1.8) bindex (0.8.1) @@ -99,6 +100,7 @@ GEM debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) + diff-lcs (1.5.1) drb (2.2.1) erubi (1.13.0) globalid (1.2.1) @@ -116,6 +118,8 @@ GEM jbuilder (2.12.0) actionview (>= 5.0.0) activesupport (>= 5.0.0) + json (2.7.2) + language_server-protocol (3.17.0.3) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -144,8 +148,14 @@ GEM racc (~> 1.4) nokogiri (1.16.6-arm64-darwin) racc (~> 1.4) + nokogiri (1.16.6-x86_64-darwin) + racc (~> 1.4) nokogiri (1.16.6-x86_64-linux) racc (~> 1.4) + parallel (1.25.1) + parser (3.3.3.0) + ast (~> 2.4.1) + racc psych (5.1.2) stringio public_suffix (5.0.5) @@ -189,6 +199,7 @@ GEM rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) + rainbow (3.1.1) rake (13.2.1) rdoc (6.7.0) psych (>= 4.0.0) @@ -197,6 +208,37 @@ GEM io-console (~> 0.5) rexml (3.3.0) strscan + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (6.1.3) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.1) + rubocop (1.64.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + ruby-progressbar (1.13.0) rubyzip (2.3.2) selenium-webdriver (4.21.1) base64 (~> 0.2) @@ -212,6 +254,7 @@ GEM sprockets (>= 3.0.0) sqlite3 (1.7.3-aarch64-linux) sqlite3 (1.7.3-arm64-darwin) + sqlite3 (1.7.3-x86_64-darwin) sqlite3 (1.7.3-x86_64-linux) stimulus-rails (1.3.3) railties (>= 6.0.0) @@ -225,6 +268,7 @@ GEM railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) @@ -242,6 +286,7 @@ GEM PLATFORMS aarch64-linux arm64-darwin-22 + x86_64-darwin-22 x86_64-linux DEPENDENCIES @@ -252,6 +297,8 @@ DEPENDENCIES jbuilder puma (>= 5.0) rails (~> 7.1.3, >= 7.1.3.4) + rspec-rails + rubocop selenium-webdriver sprockets-rails sqlite3 (~> 1.4)