Skip to content
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

Separately run Accessibility browser tests #1378

Merged
merged 6 commits into from
Sep 16, 2022
Merged
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
25 changes: 23 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ jobs:
gem install bundler:2.2.9
bundle config path vendor/bundle
bundle update actionview activemodel activesupport railties actioncable
bundle exec rake docs:preview
bundle exec rake
bundle exec rake test:fast
env:
RAILS_VERSION: ${{ matrix.rails_version }}
COVERAGE: 1
Expand Down Expand Up @@ -129,3 +128,25 @@ jobs:
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec rake coverage:report
system:
name: Accessibility
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just generally call this System or Browser? Though the a11y test, doc_examples_axe_test is taking the most time, there's more general component tests as well for testing behavior.

system test folder

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.7.x
- uses: actions/setup-node@v2
with:
node-version: 14
- run: |
yarn
cd demo && yarn
- name: Build and test with Rake
run: |
gem install bundler:2.2.9
bundle config path vendor/bundle
bundle update actionview activemodel activesupport railties actioncable
bundle exec rake docs:preview
bundle exec rake test:system
14 changes: 0 additions & 14 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@ require "yard/renders_many_handler"
require "yaml"
require "pathname"

Rake::TestTask.new(:test) do |t|
ENV["TZ"] = "Asia/Taipei"

t.libs << "test"
t.libs << "lib"
t.test_files = FileList[ENV["TESTS"] || "test/**/*_test.rb"]
end

Rake::TestTask.new(:bench) do |t|
t.libs << "test"
t.test_files = FileList["test/benchmarks/**/bench_*.rb"]
t.verbose = true
end

Rake.add_rakelib "lib/tasks"

task default: :test
2 changes: 1 addition & 1 deletion demo/app/controllers/auto_complete_test_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# no doc
# :nocov:
class AutoCompleteTestController < ApplicationController
layout false

Expand Down
1 change: 1 addition & 0 deletions demo/app/controllers/toggle_switch_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

# For toggle switch previews/tests
# :nocov:
class ToggleSwitchController < ApplicationController
skip_before_action :verify_authenticity_token

Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/coverage.rake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace :coverage do
require "simplecov"
require "simplecov-console"

SimpleCov.minimum_coverage 100
SimpleCov.minimum_coverage 99

SimpleCov.collate Dir["simplecov-resultset-*/.resultset.json"], "rails" do
formatter SimpleCov::Formatter::Console
Expand Down
54 changes: 54 additions & 0 deletions lib/tasks/test.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# frozen_string_literal: true

require "rake/testtask"

namespace :test do
desc "Run all tests"
task all: [:fast, :system]

Rake::TestTask.new(:single) do |t|
ENV["TZ"] = "Asia/Taipei"

t.libs << "test"
t.libs << "lib"
t.test_files = FileList[ENV["TESTS"]]
end

Rake::TestTask.new(:fast) do |t|
ENV["TZ"] = "Asia/Taipei"

t.libs << "test"
t.libs << "lib"
t.test_files = FileList[
"test/components/**/*_test.rb",
"test/lib/**/*_test.rb",
"test/primer/**/*_test.rb",
"test/linters/**/*_test.rb",
"test/rubocop/**/*_test.rb"
]
end

Rake::TestTask.new(:system) do |t|
ENV["TZ"] = "Asia/Taipei"

t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/system/**/*_test.rb", "test/previews/**/*_test.rb"]
end

Rake::TestTask.new(:bench) do |t|
t.libs << "test"
t.test_files = FileList["test/benchmarks/**/bench_*.rb"]
t.verbose = true
end
end

task :test do
if ENV["TESTS"]
Rake::Task["test:single"].invoke
else
Rake::Task["test:all"].invoke
end
end

task bench: "test:bench"