diff --git a/.circleci/config.yml b/.circleci/config.yml index bab7de2c7..926275370 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,6 +22,12 @@ jobs: # This is the circleci provided Redis container. - image: circleci/redis:4.0.10 + + # localstack image + - image: localstack/localstack:latest + environment: + - SERVICES=sqs + parallelism: 1 resource_class: large steps: @@ -73,6 +79,18 @@ jobs: command: | ~/project/ci-bin/capture-log "make -f Makefile.example test" + - store_test_results: + name: Store test results as summary + path: ~/test-results + + - store_artifacts: + name: Store test results as artifact + path: ~/test-results + + - store_artifacts: + name: Store capybara screenshots + path: ~/project/tmp/capybara + - run: name: Lint command: | diff --git a/Gemfile b/Gemfile index b36f17f4e..20932393e 100644 --- a/Gemfile +++ b/Gemfile @@ -60,7 +60,8 @@ group :development, :test do end group :test do - gem "capybara", "2.6.2" + gem "capybara" + gem "capybara-screenshot" gem "database_cleaner" gem "launchy" gem "rspec" @@ -68,6 +69,7 @@ group :test do gem "simplecov" gem "sniffybara", git: "https://github.com/department-of-veterans-affairs/sniffybara.git" gem "timecop" + gem "webdrivers" gem "webmock" end diff --git a/Gemfile.lock b/Gemfile.lock index 8265399a3..cae229fe8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -61,9 +61,9 @@ GIT GIT remote: https://github.com/department-of-veterans-affairs/sniffybara.git - revision: d5f94213dcef08756f8d1622355015739e96ff4f + revision: 351560b5789ca638ba7c9b093c2bb1a9a6fda4b3 specs: - sniffybara (0.0.1) + sniffybara (1.1.0) rainbow selenium-webdriver @@ -115,8 +115,8 @@ GEM i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) akami (1.3.1) gyoku (>= 0.4.0) nokogiri @@ -150,17 +150,20 @@ GEM bundler (~> 1.2) thor (~> 0.18) byebug (10.0.0) - capybara (2.6.2) + capybara (3.29.0) addressable - mime-types (>= 1.16) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + capybara-screenshot (1.0.23) + capybara (>= 1.0, < 4) + launchy case_transform (0.2) activesupport - childprocess (0.9.0) - ffi (~> 1.0, >= 1.0.11) + childprocess (3.0.0) coderay (1.1.2) coffee-rails (4.2.2) coffee-script (>= 2.2.0) @@ -193,7 +196,7 @@ GEM faraday (0.14.0) multipart-post (>= 1.2, < 3) fastercsv (1.5.5) - ffi (1.9.25) + ffi (1.11.3) globalid (0.4.2) activesupport (>= 4.2.0) gyoku (1.3.1) @@ -235,9 +238,9 @@ GEM makara (0.4.1) activerecord (>= 3.0.0) method_source (0.9.2) - mime-types (3.1) + mime-types (3.3) mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) + mime-types-data (3.2019.1009) mini_magick (4.9.4) mini_mime (1.0.1) mini_portile2 (2.4.0) @@ -251,7 +254,7 @@ GEM thor (~> 0.19) newrelic_rpm (4.8.0.341) nio4r (2.3.1) - nokogiri (1.10.5) + nokogiri (1.10.7) mini_portile2 (~> 2.4.0) nori (2.6.0) omniauth (1.9.0) @@ -271,7 +274,7 @@ GEM byebug (~> 10.0) pry (~> 0.10) psych (3.1.0) - public_suffix (3.0.2) + public_suffix (4.0.1) puma (3.12.2) rack (2.0.7) rack-cors (1.1.0) @@ -331,6 +334,7 @@ GEM redis-store (1.4.1) redis (>= 2.2, < 5) ref (2.0.0) + regexp_parser (1.6.0) request_store (1.4.0) rack (>= 1.4) rspec (3.7.0) @@ -398,9 +402,9 @@ GEM sdoc (0.4.2) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) - selenium-webdriver (3.11.0) - childprocess (~> 0.5) - rubyzip (~> 1.2) + selenium-webdriver (3.142.6) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) sentry-raven (2.7.2) faraday (>= 0.7.6, < 1.0) sexp_processor (4.10.1) @@ -448,6 +452,10 @@ GEM wasabi (3.5.0) httpi (~> 2.0) nokogiri (>= 1.4.2) + webdrivers (4.1.2) + nokogiri (~> 1.6) + rubyzip (~> 1.0) + selenium-webdriver (>= 3.0, < 4.0) webmock (3.6.2) addressable (>= 2.3.6) crack (>= 0.3.2) @@ -464,8 +472,8 @@ GEM xmlmapper (>= 0.7.3) xmlmapper (0.7.3) nokogiri (~> 1.5) - xpath (2.1.0) - nokogiri (~> 1.3) + xpath (3.2.0) + nokogiri (~> 1.8) zaru (0.2.0) zero_downtime_migrations (0.0.7) activerecord @@ -482,7 +490,8 @@ DEPENDENCIES brakeman (= 3.1.5) bundler-audit byebug - capybara (= 2.6.2) + capybara + capybara-screenshot caseflow! coffee-rails (> 4.1.0) connect_vbms! @@ -533,6 +542,7 @@ DEPENDENCIES uglifier (>= 1.3.0) uswds-rails! wannabe_bool + webdrivers webmock zaru zero_downtime_migrations diff --git a/Makefile.example b/Makefile.example index f7fb991e5..ed5de364c 100644 --- a/Makefile.example +++ b/Makefile.example @@ -17,7 +17,7 @@ run: up ## Start Rails foreman start test: clean ## Run the rspec suite - bundle exec rspec + CI=true bundle exec rspec clean: ## Remove old files rm -f log/test.log diff --git a/app/controllers/downloads_controller.rb b/app/controllers/downloads_controller.rb index 0dcfac10a..09d409980 100644 --- a/app/controllers/downloads_controller.rb +++ b/app/controllers/downloads_controller.rb @@ -1,4 +1,5 @@ class DownloadsController < ApplicationController + # :nocov: before_action :authorize rescue_from ActiveRecord::RecordNotFound, with: :record_not_found @@ -152,4 +153,5 @@ def current_document_status { "progress": 0, "completed": 1, "errored": 2 }[current_tab.to_sym] end helper_method :current_document_status + # :nocov: end diff --git a/app/models/fetcher.rb b/app/models/fetcher.rb index 6d98c2f73..8b5144961 100644 --- a/app/models/fetcher.rb +++ b/app/models/fetcher.rb @@ -13,7 +13,7 @@ def content(save_document_metadata: true) private def cached_content - @cached_content ||= MetricsService.record("S3: fetch content for: #{document.s3_filename}", + @cached_content ||= MetricsService.record("S3: Fetcher fetch content for: #{document.s3_filename}", service: :s3, name: "fetch_content") do S3Service.fetch_content(document.s3_filename) diff --git a/app/services/record_fetcher.rb b/app/services/record_fetcher.rb index 1a847a2d9..8bbf35631 100644 --- a/app/services/record_fetcher.rb +++ b/app/services/record_fetcher.rb @@ -9,6 +9,7 @@ class RecordFetcher def process s = Redis::Semaphore.new("record_#{record.id}".to_s, url: Rails.application.secrets.redis_url_cache, + stale_client_timeout: 5, expiration: SECONDS_TO_AUTO_UNLOCK) s.lock(SECONDS_TO_AUTO_UNLOCK) content_from_s3 || content_from_vbms @@ -28,7 +29,7 @@ def content_from_vbms end def content_from_s3 - @content_from_s3 ||= MetricsService.record("S3: fetch content for: #{record.s3_filename}", + @content_from_s3 ||= MetricsService.record("S3: RecordFetcher fetch content for: #{record.s3_filename}", service: :s3, name: "content_from_s3") do S3Service.fetch_content(record.s3_filename) diff --git a/app/views/gui/single_page_app.html.erb b/app/views/gui/single_page_app.html.erb index 03d8fd12b..b4911d5ed 100644 --- a/app/views/gui/single_page_app.html.erb +++ b/app/views/gui/single_page_app.html.erb @@ -1,4 +1,4 @@ - +
Learn how to gain access and login to eFolder Express
Learn how to use eFolder Express and improve your workflow.
Learn how to search for the full contents of a veteran's eFolder
@@ -34,21 +34,21 @@Learn how to download the files contained in a Veteran's eFolder.
Learn how to improve your workflow by downloading and managing multiple Veteran's eFolder at once.
Learn how to give feedback and seek help directly from the Digital Service support team.
diff --git a/lib/fakes/test_auth_strategy.rb b/lib/fakes/test_auth_strategy.rb index d1cc2078d..294f9ae39 100644 --- a/lib/fakes/test_auth_strategy.rb +++ b/lib/fakes/test_auth_strategy.rb @@ -1,10 +1,29 @@ require "omniauth/strategies/developer" require "omniauth/form" +class EfolderAuthForm < OmniAuth::Form + def header(title, header_info) + @html << <<-HTML + + + + +