Skip to content

Run all tests in CI #336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ jobs:
# Yarn Update

- run: yarn install
- run: cd spec/dummy
- run: yarn install
- run: cd spec/dummy && yarn install

# Database setup
- run: bundle exec rake db:create
Expand All @@ -51,7 +50,7 @@ jobs:
name: run tests
command: |
mkdir /tmp/test-results
TEST_FILES="$(circleci tests glob "spec/usage/**/*_spec.rb" | circleci tests split --split-by=timings)"
TEST_FILES="$(circleci tests glob "spec/usage/**/*_spec.rb" "spec/lib/**/*_spec.rb" | circleci tests split --split-by=timings)"

bundle exec rspec --format progress \
--out /tmp/test-results/rspec.xml \
Expand Down
8 changes: 8 additions & 0 deletions spec/dummy/docs/components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Core Components

This file exists here currently just so that the tests for `Matestack::Core::Generators::ComponentGenerator` can run as they expect such a file to exist.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonasjabari this is a ... very pragmatic solution but potentially not the best one. Please check the commit message :)


## Static Core Components


## Dynamic Core Components
1,796 changes: 1,293 additions & 503 deletions spec/dummy/yarn.lock

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions spec/usage/base/app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@

describe "App", type: :feature, js: true do

before :all do

Rails.application.routes.append do
get 'app_specs/my_example_app/page1', to: 'example_app_pages#page1', as: 'app_specs_page1'
get 'app_specs/my_example_app/page2', to: 'example_app_pages#page2', as: 'app_specs_page2'
end
Rails.application.reload_routes!

end

it "can wrap pages with a layout" do

class Apps::ExampleApp < Matestack::Ui::App
Expand Down Expand Up @@ -56,7 +46,7 @@ def response

end

class ExampleAppPagesController < ExampleController
class ExampleAppPagesAController < ExampleController
include Matestack::Ui::Core::ApplicationHelper

def page1
Expand All @@ -69,6 +59,11 @@ def page2

end

Rails.application.routes.draw do
get 'app_specs/my_example_app/page1', to: 'example_app_pages_a#page1', as: 'app_specs_page1'
get 'app_specs/my_example_app/page2', to: 'example_app_pages_a#page2', as: 'app_specs_page2'
end

visit "app_specs/my_example_app/page1"

expect(page).to have_xpath('//div[@class="matestack_app"]/h1[contains(.,"My Example App Layout")]')
Expand Down Expand Up @@ -133,7 +128,7 @@ def response
end


class ExampleAppPagesController < ExampleController
class ExampleAppPagesBController < ExampleController
include Matestack::Ui::Core::ApplicationHelper

def page1
Expand All @@ -146,6 +141,11 @@ def page2

end

Rails.application.routes.draw do
get 'app_specs/my_example_app/page1', to: 'example_app_pages_b#page1', as: 'app_specs_page1'
get 'app_specs/my_example_app/page2', to: 'example_app_pages_b#page2', as: 'app_specs_page2'
end

visit "app_specs/my_example_app/page1"

expect(page).to have_xpath('//div[@class="matestack_app"]/h1[contains(.,"My Example App Layout")]')
Expand Down
18 changes: 8 additions & 10 deletions spec/usage/components/action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def action_config

end

class ExampleAppPagesController < ExampleController
class ExampleAppPagesCController < ExampleController
include Matestack::Ui::Core::ApplicationHelper

def page1
Expand All @@ -352,13 +352,12 @@ def page2

end

Rails.application.routes.append do
Rails.application.routes.draw do
scope :action_test do
get 'page1', to: 'example_app_pages#page1', as: 'action_test_page1'
get 'page2/:id', to: 'example_app_pages#page2', as: 'action_test_page2'
get 'page1', to: 'example_app_pages_c#page1', as: 'action_test_page1'
get 'page2/:id', to: 'example_app_pages_c#page2', as: 'action_test_page2'
end
end
Rails.application.reload_routes!

visit "action_test/page1"

Expand Down Expand Up @@ -611,16 +610,15 @@ def success_test
end
end

Rails.application.routes.append do
Rails.application.routes.draw do
post '/success_action_test', to: 'action_test#success_test', as: 'success_action_test_string'
scope :action_test do
get 'page1', to: 'example_app_pages#page1', as: 'action_test_page1_string'
get 'page2/:id', to: 'example_app_pages#page2', as: 'action_test_page2_string'
get 'page1', to: 'example_app_pages_d#page1', as: 'action_test_page1_string'
get 'page2/:id', to: 'example_app_pages_d#page2', as: 'action_test_page2_string'
end
end
Rails.application.reload_routes!

class ExampleAppPagesController < ExampleController
class ExampleAppPagesDController < ExampleController
include Matestack::Ui::Core::ApplicationHelper

def page1
Expand Down
12 changes: 6 additions & 6 deletions spec/usage/components/form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def form_config

end

class ExampleAppPagesController < ExampleController
class ExampleAppPagesEController < ExampleController
include Matestack::Ui::Core::ApplicationHelper

def page1
Expand All @@ -357,8 +357,8 @@ def page2

Rails.application.routes.append do
scope :form_test do
get 'page1', to: 'example_app_pages#page1', as: 'form_test_page_1'
get 'page2/:id', to: 'example_app_pages#page2', as: 'form_test_page_2'
get 'page1', to: 'example_app_pages_e#page1', as: 'form_test_page_1'
get 'page2/:id', to: 'example_app_pages_e#page2', as: 'form_test_page_2'
end
end
Rails.application.reload_routes!
Expand Down Expand Up @@ -452,7 +452,7 @@ def response

end

class ExampleAppPagesController < ExampleController
class ExampleAppPagesFController < ExampleController
include Matestack::Ui::Core::ApplicationHelper

def page3
Expand All @@ -467,8 +467,8 @@ def page4

Rails.application.routes.append do
scope :form_test do
get 'page3', to: 'example_app_pages#page3', as: 'form_test_page_3'
get 'page4/:id', to: 'example_app_pages#page4', as: 'form_test_page_4'
get 'page3', to: 'example_app_pages_f#page3', as: 'form_test_page_3'
get 'page4/:id', to: 'example_app_pages_f#page4', as: 'form_test_page_4'
end
end
Rails.application.reload_routes!
Expand Down
9 changes: 4 additions & 5 deletions spec/usage/components/transition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def response

end

class ExampleAppPagesController < ExampleController
class ExampleAppPagesGController < ExampleController
include Matestack::Ui::Core::ApplicationHelper

def page1
Expand All @@ -72,11 +72,10 @@ def page2

end

Rails.application.routes.append do
get 'my_example_app/page1', to: 'example_app_pages#page1', as: 'page1'
get 'my_example_app/page2', to: 'example_app_pages#page2', as: 'page2'
Rails.application.routes.draw do
get 'my_example_app/page1', to: 'example_app_pages_g#page1', as: 'page1'
get 'my_example_app/page2', to: 'example_app_pages_g#page2', as: 'page2'
end
Rails.application.reload_routes!

visit "/my_example_app/page1"

Expand Down