diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 0fd7183..f3a0d22 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -9,180 +9,55 @@ auto_cancel: when: "branch != 'master'" blocks: - - name: Build + dependencies: [] execution_time_limit: - minutes: 10 + minutes: 20 task: agent: machine: type: e1-standard-2 os_image: ubuntu1804 env_vars: - # - name: TEST_DATABASE_URL - # value: postgres://postgres:@0.0.0.0/ninja_master_test + - name: TEST_DATABASE_URL + value: postgres://postgres:@0.0.0.0/semaphore_2_rails_demo_test - name: RAILS_ENV value: test - - name: NODE_ENV - value: tes - - name: TEST_BOOSTERS_RSPEC_TEST_FILE_PATTERN - value: "spec/system/**/*_spec.rb" + - name: HONEYBADGER_SOURCE_MAP_DISABLED + value: "true" + - name: TZ + value: America/New_York + - name: GOOGLE_MAPS_API_KEY + value: AIzninjamaster + prologue: commands: - checkout - - sem-service start postgres + - sem-service start postgres --username=postgres - sem-version ruby $(cat .ruby-version) - sem-version node $(cat .node-version) - gem install bundler --no-document - npm i -g yarn - bundle config set deployment 'true' - bundle config set path 'vendor/bundle' - # - cache restore gems-$(checksum .ruby-version)-$(checksum Gemfile.lock),gems-$(checksum .ruby-version)-,gems- - # - cache restore yarn-$(checksum .node-version)-$(checksum yarn.lock),yarn-$(checksum .node-version)-,yarn- - # - cache restore - + - cache restore gems-$(checksum .ruby-version)-$(checksum Gemfile.lock) + - cache restore yarn-cache-$(checksum .node-version)-$(checksum yarn.lock) + - cache restore yarn-node-modules-$(checksum .node-version)-$(checksum yarn.lock) jobs: - - name: Install Dependencies + - name: Install Dependencies, Run Tests commands: - - # - bundle check || bundle install - # - yarn install --check-files || yarn install - - bundle install - - yarn install - - - bundle exec rails db:setup db:test:prepare - - bin/rails webpacker:compile - # - bundle exec rspec spec/system/event_management_spec.rb - # epilogue: - # commands: - # - cache delete gems-$(checksum .ruby-version)-$(checksum Gemfile.lock) - # - cache delete gems-$(checksum .ruby-version)- - # - cache delete gems- - # - cache delete yarn-$(checksum .node-version)-$(checksum yarn.lock) - # - cache delete yarn-$(checksum .node-version)- - # - cache delete yarn- - # - cache store gems-$(checksum .ruby-version)-$(checksum Gemfile.lock) vendor/bundle - # - cache store yarn-$(checksum .node-version)-$(checksum yarn.lock) node_modules - # - cache store yarn-$(checksum .node-version)-$(checksum yarn.lock) node_modules - # - cache store - # - # - name: Style Checks - # task: - # agent: - # machine: - # type: e1-standard-2 - # os_image: ubuntu1804 - # prologue: - # commands: - # - checkout - # - sem-version ruby $(cat .ruby-version) - # - sem-version node $(cat .node-version) - # - gem install bundler --no-document - # - bundle config set deployment 'true' - # - bundle config set path 'vendor/bundle' - # # - cache restore gems-$(checksum .ruby-version)-$(checksum Gemfile.lock) #,gems-$(checksum .ruby-version)-,gems- - # - cache restore - # - bundle check || bundle install - # # - cache restore yarn-$(checksum .node-version)-$(checksum yarn.lock) #,yarn-$(checksum .node-version)-,yarn- - # - # jobs: - # - name: Linters - # commands: - # - bundle exec rubocop --fail-level warning --display-only-fail-level-offenses - # - yarn run eslint - # - yarn run stylelint - # - # - name: Unit Tests - # execution_time_limit: - # minutes: 20 - # task: - # agent: - # machine: - # type: e1-standard-8 - # os_image: ubuntu1804 - # env_vars: - # - name: TEST_DATABASE_URL - # value: postgres://postgres:@0.0.0.0/ninja_master_test - # - name: RAILS_ENV - # value: test - # - name: NODE_ENV - # value: test - # - name: HONEYBADGER_SOURCE_MAP_DISABLED - # value: "true" - # - name: TEST_BOOSTERS_RSPEC_TEST_FILE_PATTERN - # value: "spec/models/*_spec.rb" - # prologue: - # commands: - # - checkout - # - sem-service start postgres - # - sem-version ruby $(cat .ruby-version) - # - sem-version node $(cat .node-version) - # - gem install bundler --no-document - # - bundle config set deployment 'true' - # - bundle config set path 'vendor/bundle' - # - cache restore - # # - cache restore gems-$(checksum .ruby-version)-$(checksum Gemfile.lock),gems-$(checksum .ruby-version)-,gems- - # - bundle check || bundle install - # # - cache restore yarn-$(checksum .node-version)-$(checksum yarn.lock),yarn-$(checksum .node-version)-,yarn- - # - bundle exec rails db:setup db:test:prepare - # - # jobs: - # - name: Ruby Unit Tests - # parallelism: 7 - # commands: - # - gem install semaphore_test_boosters - # - rspec_booster --job $SEMAPHORE_JOB_INDEX/$SEMAPHORE_JOB_COUNT - # # - bundle exec rspec --format documentation --exclude-pattern="spec/system/**/*_spec.rb" - # - # - name: JS Tests - # commands: - # - yarn test_ci - # - # - name: Integration Tests - # execution_time_limit: - # minutes: 20 - # task: - # agent: - # machine: - # type: e1-standard-8 - # os_image: ubuntu1804 - # env_vars: - # - name: TEST_DATABASE_URL - # value: postgres://postgres:@0.0.0.0/ninja_master_test - # - name: RAILS_ENV - # value: test - # - name: NODE_ENV - # value: test - # - name: HONEYBADGER_SOURCE_MAP_DISABLED - # value: "true" - # - name: TEST_BOOSTERS_RSPEC_TEST_FILE_PATTERN - # value: "spec/system/**/*_spec.rb" - # prologue: - # commands: - # - checkout - # - sem-service start postgres - # - sem-version ruby $(cat .ruby-version) - # - sem-version node $(cat .node-version) - # - gem install bundler --no-document - # - bundle config set deployment 'true' - # - bundle config set path 'vendor/bundle' - # - cache restore - # # - cache restore gems-$(checksum .ruby-version)-$(checksum Gemfile.lock),gems-$(checksum .ruby-version)-,gems- - # - bundle check || bundle install - # # - cache restore yarn-$(checksum .node-version)-$(checksum yarn.lock),yarn-$(checksum .node-version)-,yarn- - # - bundle exec rails db:setup db:test:prepare - # - bin/rails webpacker:compile - # - # jobs: - # - name: System Tests - # parallelism: 8 - # commands: - # - gem install semaphore_test_boosters - # - rspec_booster --job $SEMAPHORE_JOB_INDEX/$SEMAPHORE_JOB_COUNT - # - # epilogue: - # on_fail: - # commands: - # - artifact push job log/test.log - # - artifact push job tmp/screenshots + - bundle check || bundle install + - yarn check || yarn install + - cache store gems-$(checksum .ruby-version)-$(checksum Gemfile.lock) vendor/bundle + - cache store yarn-cache-$(checksum .node-version)-$(checksum yarn.lock) /home/semaphore/.cache/yarn + - cache store yarn-node-modules-$(checksum .node-version)-$(checksum yarn.lock) node_modules + - bundle exec rails db:setup + - bundle exec rails webpacker:compile + - bundle exec rake + epilogue: + on_fail: + commands: + - artifact push job log/test.log + - artifact push job tmp/screenshots + - ls spec/e2e/screenshots diff --git a/Gemfile b/Gemfile index 85ca524..f88c5d4 100644 --- a/Gemfile +++ b/Gemfile @@ -50,7 +50,7 @@ group :development, :test do end group :development do - gem 'rolemodel_rails', github: 'RoleModel/rolemodel_rails' + # gem 'rolemodel_rails', github: 'RoleModel/rolemodel_rails' # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '~> 3.2' diff --git a/Gemfile.lock b/Gemfile.lock index fd4157d..a97a582 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,62 +1,56 @@ -GIT - remote: https://github.com/RoleModel/rolemodel_rails.git - revision: 3749c8a6fc9ac2011cdaa8a19ababb1fb5009c04 - specs: - rolemodel_rails (0.1.0) - GEM remote: https://rubygems.org/ specs: - actioncable (6.0.3.5) - actionpack (= 6.0.3.5) + actioncable (6.0.3.6) + actionpack (= 6.0.3.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.3.5) - actionpack (= 6.0.3.5) - activejob (= 6.0.3.5) - activerecord (= 6.0.3.5) - activestorage (= 6.0.3.5) - activesupport (= 6.0.3.5) + actionmailbox (6.0.3.6) + actionpack (= 6.0.3.6) + activejob (= 6.0.3.6) + activerecord (= 6.0.3.6) + activestorage (= 6.0.3.6) + activesupport (= 6.0.3.6) mail (>= 2.7.1) - actionmailer (6.0.3.5) - actionpack (= 6.0.3.5) - actionview (= 6.0.3.5) - activejob (= 6.0.3.5) + actionmailer (6.0.3.6) + actionpack (= 6.0.3.6) + actionview (= 6.0.3.6) + activejob (= 6.0.3.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.3.5) - actionview (= 6.0.3.5) - activesupport (= 6.0.3.5) + actionpack (6.0.3.6) + actionview (= 6.0.3.6) + activesupport (= 6.0.3.6) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.3.5) - actionpack (= 6.0.3.5) - activerecord (= 6.0.3.5) - activestorage (= 6.0.3.5) - activesupport (= 6.0.3.5) + actiontext (6.0.3.6) + actionpack (= 6.0.3.6) + activerecord (= 6.0.3.6) + activestorage (= 6.0.3.6) + activesupport (= 6.0.3.6) nokogiri (>= 1.8.5) - actionview (6.0.3.5) - activesupport (= 6.0.3.5) + actionview (6.0.3.6) + activesupport (= 6.0.3.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.0.3.5) - activesupport (= 6.0.3.5) + activejob (6.0.3.6) + activesupport (= 6.0.3.6) globalid (>= 0.3.6) - activemodel (6.0.3.5) - activesupport (= 6.0.3.5) - activerecord (6.0.3.5) - activemodel (= 6.0.3.5) - activesupport (= 6.0.3.5) - activestorage (6.0.3.5) - actionpack (= 6.0.3.5) - activejob (= 6.0.3.5) - activerecord (= 6.0.3.5) - marcel (~> 0.3.1) - activesupport (6.0.3.5) + activemodel (6.0.3.6) + activesupport (= 6.0.3.6) + activerecord (6.0.3.6) + activemodel (= 6.0.3.6) + activesupport (= 6.0.3.6) + activestorage (6.0.3.6) + actionpack (= 6.0.3.6) + activejob (= 6.0.3.6) + activerecord (= 6.0.3.6) + marcel (~> 1.0.0) + activesupport (6.0.3.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -98,28 +92,26 @@ GEM ffi (1.14.2) globalid (0.4.2) activesupport (>= 4.2.0) - i18n (1.8.9) + i18n (1.8.10) concurrent-ruby (~> 1.0) jbuilder (2.11.2) activesupport (>= 5.0.0) listen (3.4.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.9.0) + loofah (2.9.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) + marcel (1.0.1) method_source (1.0.0) - mimemagic (0.3.5) - mini_mime (1.0.2) + mini_mime (1.1.0) mini_portile2 (2.5.0) minitest (5.14.4) msgpack (1.4.2) - nio4r (2.5.5) - nokogiri (1.11.1) + nio4r (2.5.7) + nokogiri (1.11.3) mini_portile2 (~> 2.5.0) racc (~> 1.4) parallel (1.20.1) @@ -138,29 +130,29 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.3.5) - actioncable (= 6.0.3.5) - actionmailbox (= 6.0.3.5) - actionmailer (= 6.0.3.5) - actionpack (= 6.0.3.5) - actiontext (= 6.0.3.5) - actionview (= 6.0.3.5) - activejob (= 6.0.3.5) - activemodel (= 6.0.3.5) - activerecord (= 6.0.3.5) - activestorage (= 6.0.3.5) - activesupport (= 6.0.3.5) + rails (6.0.3.6) + actioncable (= 6.0.3.6) + actionmailbox (= 6.0.3.6) + actionmailer (= 6.0.3.6) + actionpack (= 6.0.3.6) + actiontext (= 6.0.3.6) + actionview (= 6.0.3.6) + activejob (= 6.0.3.6) + activemodel (= 6.0.3.6) + activerecord (= 6.0.3.6) + activestorage (= 6.0.3.6) + activesupport (= 6.0.3.6) bundler (>= 1.3.0) - railties (= 6.0.3.5) + railties (= 6.0.3.6) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - railties (6.0.3.5) - actionpack (= 6.0.3.5) - activesupport (= 6.0.3.5) + railties (6.0.3.6) + actionpack (= 6.0.3.6) + activesupport (= 6.0.3.6) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) @@ -289,7 +281,6 @@ DEPENDENCIES puma (~> 4.1) rails (~> 6.0.3, >= 6.0.3.5) react-rails - rolemodel_rails! rspec-rails rubocop rubocop-rails diff --git a/config/database.yml b/config/database.yml index 17fb2d8..d2b9f29 100644 --- a/config/database.yml +++ b/config/database.yml @@ -24,6 +24,7 @@ default: &default development: <<: *default database: semaphore_2_rails_demo_development + username: postgres # The specified database role being used to connect to postgres. # To create additional roles in postgres see `$ createuser --help`. @@ -58,6 +59,7 @@ development: test: <<: *default database: semaphore_2_rails_demo_test + username: postgres # As with config/credentials.yml, you never want to store sensitive information, # like your database password, in your source code. If your source code is diff --git a/spec/javascript/components/.keep b/spec/javascript/components/.keep new file mode 100644 index 0000000..e69de29 diff --git a/spec/system/basic_spec.rb b/spec/system/basic_spec.rb index 16ed16b..cbe2e72 100644 --- a/spec/system/basic_spec.rb +++ b/spec/system/basic_spec.rb @@ -2,10 +2,34 @@ require 'rails_helper' -RSpec.describe 'Basic', type: :system, chrome: true do +RSpec.describe 'Basic', type: :system, js: true do it 'can render react' do visit styleguide_path - binding.pry expect(page).to have_content 'THIS COMPONENT CAN RENDER' end + + it 'can store artifacts 1' do + visit root_path + expect(page).to have_content 'Apple1' + end + it 'can store artifacts 2' do + visit root_path + expect(page).to have_content 'Apple2' + end + it 'can store artifacts 3' do + visit root_path + expect(page).to have_content 'Apple3' + end + it 'can store artifacts 4' do + visit root_path + expect(page).to have_content 'Apple4' + end + it 'can store artifacts 5' do + visit root_path + expect(page).to have_content 'Apple5' + end + it 'can store artifacts 6' do + visit root_path + expect(page).to have_content 'Apple6' + end end