diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml
new file mode 100644
index 000000000..1965a4034
--- /dev/null
+++ b/.github/workflows/run_tests.yml
@@ -0,0 +1,411 @@
+name: Run Tests
+
+on:
+ workflow_call:
+ pull_request:
+ types:
+ - opened
+ - synchronize
+ merge_group:
+ workflow_dispatch:
+
+defaults:
+ run:
+ shell: bash
+
+jobs:
+ test:
+ name: Tests
+ runs-on: ubuntu-latest
+
+ services:
+ postgres:
+ image: postgres:13.5
+ env:
+ POSTGRES_PASSWORD: password
+ POSTGRES_USER: postgres
+ POSTGRES_DB: data_collector
+ ports:
+ - 5432:5432
+ # Needed because the Postgres container does not provide a health check
+ # tmpfs makes database faster by using RAM
+ options: >-
+ --mount type=tmpfs,destination=/var/lib/postgresql/data
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+
+ env:
+ RAILS_ENV: test
+ GEMFILE_RUBY_VERSION: 3.1.1
+ DB_HOST: localhost
+ DB_DATABASE: data_collector
+ DB_USERNAME: postgres
+ DB_PASSWORD: password
+ RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
+ PARALLEL_TEST_PROCESSORS: 4
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ bundler-cache: true
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ cache: yarn
+ node-version: 20
+
+ - name: Create database
+ run: |
+ bundle exec rake parallel:setup
+
+ - name: Compile assets
+ run: |
+ bundle exec rake assets:precompile
+
+ - name: Run tests
+ run: |
+ bundle exec rake parallel:spec['spec\/(?!features|models|requests|services)']
+
+ feature_test:
+ name: Feature Tests
+ runs-on: ubuntu-latest
+
+ services:
+ postgres:
+ image: postgres:13.5
+ env:
+ POSTGRES_PASSWORD: password
+ POSTGRES_USER: postgres
+ POSTGRES_DB: data_collector
+ ports:
+ - 5432:5432
+ # Needed because the Postgres container does not provide a health check
+ # tmpfs makes database faster by using RAM
+ options: >-
+ --mount type=tmpfs,destination=/var/lib/postgresql/data
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+
+ env:
+ RAILS_ENV: test
+ GEMFILE_RUBY_VERSION: 3.1.1
+ DB_HOST: localhost
+ DB_DATABASE: data_collector
+ DB_USERNAME: postgres
+ DB_PASSWORD: password
+ RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ bundler-cache: true
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ cache: yarn
+ node-version: 20
+
+ - name: Create database
+ run: |
+ bundle exec rake db:prepare
+
+ - name: Compile assets
+ run: |
+ bundle exec rake assets:precompile
+
+ - name: Run tests
+ run: |
+ bundle exec rspec spec/features --fail-fast --exclude-pattern "spec/features/accessibility_spec.rb"
+
+ model_test:
+ name: Model tests
+ runs-on: ubuntu-latest
+
+ services:
+ postgres:
+ image: postgres:13.5
+ env:
+ POSTGRES_PASSWORD: password
+ POSTGRES_USER: postgres
+ POSTGRES_DB: data_collector
+ ports:
+ - 5432:5432
+ # Needed because the Postgres container does not provide a health check
+ # tmpfs makes database faster by using RAM
+ options: >-
+ --mount type=tmpfs,destination=/var/lib/postgresql/data
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+
+ env:
+ RAILS_ENV: test
+ GEMFILE_RUBY_VERSION: 3.1.1
+ DB_HOST: localhost
+ DB_DATABASE: data_collector
+ DB_USERNAME: postgres
+ DB_PASSWORD: password
+ RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ bundler-cache: true
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ cache: yarn
+ node-version: 20
+
+ - name: Create database
+ run: |
+ bundle exec rake db:prepare
+
+ - name: Compile assets
+ run: |
+ bundle exec rake assets:precompile
+
+ - name: Run tests
+ run: |
+ bundle exec rspec spec/models --fail-fast
+
+ requests_test:
+ name: Requests tests
+ runs-on: ubuntu-latest
+
+ services:
+ postgres:
+ image: postgres:13.5
+ env:
+ POSTGRES_PASSWORD: password
+ POSTGRES_USER: postgres
+ POSTGRES_DB: data_collector
+ ports:
+ - 5432:5432
+ # Needed because the Postgres container does not provide a health check
+ # tmpfs makes database faster by using RAM
+ options: >-
+ --mount type=tmpfs,destination=/var/lib/postgresql/data
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+
+ env:
+ RAILS_ENV: test
+ GEMFILE_RUBY_VERSION: 3.1.1
+ DB_HOST: localhost
+ DB_DATABASE: data_collector
+ DB_USERNAME: postgres
+ DB_PASSWORD: password
+ RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
+ PARALLEL_TEST_PROCESSORS: 4
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ bundler-cache: true
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ cache: yarn
+ node-version: 20
+
+ - name: Create database
+ run: |
+ bundle exec rake parallel:setup
+
+ - name: Compile assets
+ run: |
+ bundle exec rake assets:precompile
+
+ - name: Run tests
+ run: |
+ bundle exec rake parallel:spec['spec/requests']
+
+ services_test:
+ name: Services Tests
+ runs-on: ubuntu-latest
+
+ services:
+ postgres:
+ image: postgres:13.5
+ env:
+ POSTGRES_PASSWORD: password
+ POSTGRES_USER: postgres
+ POSTGRES_DB: data_collector
+ ports:
+ - 5432:5432
+ # Needed because the Postgres container does not provide a health check
+ # tmpfs makes database faster by using RAM
+ options: >-
+ --mount type=tmpfs,destination=/var/lib/postgresql/data
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+
+ env:
+ RAILS_ENV: test
+ GEMFILE_RUBY_VERSION: 3.1.1
+ DB_HOST: localhost
+ DB_DATABASE: data_collector
+ DB_USERNAME: postgres
+ DB_PASSWORD: password
+ RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
+ PARALLEL_TEST_PROCESSORS: 4
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ bundler-cache: true
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ cache: yarn
+ node-version: 20
+
+ - name: Create database
+ run: |
+ bundle exec rake parallel:setup
+
+ - name: Compile assets
+ run: |
+ bundle exec rake assets:precompile
+
+ - name: Run tests
+ run: |
+ bundle exec rake parallel:spec['spec\/services']
+
+ accessibility_test:
+ name: Accessibility tests
+ runs-on: ubuntu-latest
+
+ services:
+ postgres:
+ image: postgres:13.5
+ env:
+ POSTGRES_PASSWORD: password
+ POSTGRES_USER: postgres
+ POSTGRES_DB: data_collector
+ ports:
+ - 5432:5432
+ # Needed because the Postgres container does not provide a health check
+ # tmpfs makes database faster by using RAM
+ options: >-
+ --mount type=tmpfs,destination=/var/lib/postgresql/data
+ --health-cmd pg_isready
+ --health-interval 10s
+ --health-timeout 5s
+ --health-retries 5
+
+ env:
+ RAILS_ENV: test
+ GEMFILE_RUBY_VERSION: 3.1.1
+ DB_HOST: localhost
+ DB_DATABASE: data_collector
+ DB_USERNAME: postgres
+ DB_PASSWORD: password
+ RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
+ PARALLEL_TEST_PROCESSORS: 4
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ bundler-cache: true
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ cache: yarn
+ node-version: 20
+
+ - name: Create database
+ run: |
+ bundle exec rake parallel:setup
+
+ - name: Compile assets
+ run: |
+ bundle exec rake assets:precompile
+
+ - name: Run tests
+ run: |
+ bundle exec rspec spec/features/accessibility_spec.rb --fail-fast
+
+ lint:
+ name: Lint
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ bundler-cache: true
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ cache: yarn
+ node-version: 20
+
+ - name: Install packages and symlink local dependencies
+ run: |
+ yarn install --immutable --immutable-cache --check-cache
+
+ - name: Lint
+ run: |
+ bundle exec rake lint
+
+ audit:
+ name: Audit dependencies
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ bundler-cache: true
+
+ - name: Audit
+ run: |
+ bundle exec bundler-audit
diff --git a/.github/workflows/staging_pipeline.yml b/.github/workflows/staging_pipeline.yml
index aff0fe5f0..a2e777db0 100644
--- a/.github/workflows/staging_pipeline.yml
+++ b/.github/workflows/staging_pipeline.yml
@@ -4,11 +4,6 @@ on:
push:
branches:
- main
- pull_request:
- types:
- - opened
- - synchronize
- merge_group:
workflow_dispatch:
defaults:
@@ -21,347 +16,13 @@ env:
repository: core
jobs:
- test:
- name: Tests
- runs-on: ubuntu-latest
-
- services:
- postgres:
- image: postgres:13.5
- env:
- POSTGRES_PASSWORD: password
- POSTGRES_USER: postgres
- POSTGRES_DB: data_collector
- ports:
- - 5432:5432
- # Needed because the Postgres container does not provide a health check
- # tmpfs makes database faster by using RAM
- options: >-
- --mount type=tmpfs,destination=/var/lib/postgresql/data
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
-
- env:
- RAILS_ENV: test
- GEMFILE_RUBY_VERSION: 3.1.1
- DB_HOST: localhost
- DB_DATABASE: data_collector
- DB_USERNAME: postgres
- DB_PASSWORD: password
- RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
- PARALLEL_TEST_PROCESSORS: 4
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Set up Ruby
- uses: ruby/setup-ruby@v1
- with:
- bundler-cache: true
-
- - name: Set up Node.js
- uses: actions/setup-node@v4
- with:
- cache: yarn
- node-version: 20
-
- - name: Create database
- run: |
- bundle exec rake parallel:setup
-
- - name: Compile assets
- run: |
- bundle exec rake assets:precompile
-
- - name: Run tests
- run: |
- bundle exec rake parallel:spec['spec\/(?!features|models|requests)']
-
- feature_test:
- name: Feature Tests
- runs-on: ubuntu-latest
-
- services:
- postgres:
- image: postgres:13.5
- env:
- POSTGRES_PASSWORD: password
- POSTGRES_USER: postgres
- POSTGRES_DB: data_collector
- ports:
- - 5432:5432
- # Needed because the Postgres container does not provide a health check
- # tmpfs makes database faster by using RAM
- options: >-
- --mount type=tmpfs,destination=/var/lib/postgresql/data
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
-
- env:
- RAILS_ENV: test
- GEMFILE_RUBY_VERSION: 3.1.1
- DB_HOST: localhost
- DB_DATABASE: data_collector
- DB_USERNAME: postgres
- DB_PASSWORD: password
- RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Set up Ruby
- uses: ruby/setup-ruby@v1
- with:
- bundler-cache: true
-
- - name: Set up Node.js
- uses: actions/setup-node@v4
- with:
- cache: yarn
- node-version: 20
-
- - name: Create database
- run: |
- bundle exec rake db:prepare
-
- - name: Compile assets
- run: |
- bundle exec rake assets:precompile
-
- - name: Run tests
- run: |
- bundle exec rspec spec/features --fail-fast --exclude-pattern "spec/features/accessibility_spec.rb"
-
- model_test:
- name: Model tests
- runs-on: ubuntu-latest
-
- services:
- postgres:
- image: postgres:13.5
- env:
- POSTGRES_PASSWORD: password
- POSTGRES_USER: postgres
- POSTGRES_DB: data_collector
- ports:
- - 5432:5432
- # Needed because the Postgres container does not provide a health check
- # tmpfs makes database faster by using RAM
- options: >-
- --mount type=tmpfs,destination=/var/lib/postgresql/data
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
-
- env:
- RAILS_ENV: test
- GEMFILE_RUBY_VERSION: 3.1.1
- DB_HOST: localhost
- DB_DATABASE: data_collector
- DB_USERNAME: postgres
- DB_PASSWORD: password
- RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Set up Ruby
- uses: ruby/setup-ruby@v1
- with:
- bundler-cache: true
-
- - name: Set up Node.js
- uses: actions/setup-node@v4
- with:
- cache: yarn
- node-version: 20
-
- - name: Create database
- run: |
- bundle exec rake db:prepare
-
- - name: Compile assets
- run: |
- bundle exec rake assets:precompile
-
- - name: Run tests
- run: |
- bundle exec rspec spec/models --fail-fast
-
- requests_test:
- name: Requests tests
- runs-on: ubuntu-latest
-
- services:
- postgres:
- image: postgres:13.5
- env:
- POSTGRES_PASSWORD: password
- POSTGRES_USER: postgres
- POSTGRES_DB: data_collector
- ports:
- - 5432:5432
- # Needed because the Postgres container does not provide a health check
- # tmpfs makes database faster by using RAM
- options: >-
- --mount type=tmpfs,destination=/var/lib/postgresql/data
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
-
- env:
- RAILS_ENV: test
- GEMFILE_RUBY_VERSION: 3.1.1
- DB_HOST: localhost
- DB_DATABASE: data_collector
- DB_USERNAME: postgres
- DB_PASSWORD: password
- RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
- PARALLEL_TEST_PROCESSORS: 4
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Set up Ruby
- uses: ruby/setup-ruby@v1
- with:
- bundler-cache: true
-
- - name: Set up Node.js
- uses: actions/setup-node@v4
- with:
- cache: yarn
- node-version: 20
-
- - name: Create database
- run: |
- bundle exec rake parallel:setup
-
- - name: Compile assets
- run: |
- bundle exec rake assets:precompile
-
- - name: Run tests
- run: |
- bundle exec rake parallel:spec['spec/requests']
-
- accessibility_test:
- name: Accessibility tests
- runs-on: ubuntu-latest
-
- services:
- postgres:
- image: postgres:13.5
- env:
- POSTGRES_PASSWORD: password
- POSTGRES_USER: postgres
- POSTGRES_DB: data_collector
- ports:
- - 5432:5432
- # Needed because the Postgres container does not provide a health check
- # tmpfs makes database faster by using RAM
- options: >-
- --mount type=tmpfs,destination=/var/lib/postgresql/data
- --health-cmd pg_isready
- --health-interval 10s
- --health-timeout 5s
- --health-retries 5
-
- env:
- RAILS_ENV: test
- GEMFILE_RUBY_VERSION: 3.1.1
- DB_HOST: localhost
- DB_DATABASE: data_collector
- DB_USERNAME: postgres
- DB_PASSWORD: password
- RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
- PARALLEL_TEST_PROCESSORS: 4
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Set up Ruby
- uses: ruby/setup-ruby@v1
- with:
- bundler-cache: true
-
- - name: Set up Node.js
- uses: actions/setup-node@v4
- with:
- cache: yarn
- node-version: 20
-
- - name: Create database
- run: |
- bundle exec rake parallel:setup
-
- - name: Compile assets
- run: |
- bundle exec rake assets:precompile
-
- - name: Run tests
- run: |
- bundle exec rspec spec/features/accessibility_spec.rb --fail-fast
-
- lint:
- name: Lint
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Set up Ruby
- uses: ruby/setup-ruby@v1
- with:
- bundler-cache: true
-
- - name: Set up Node.js
- uses: actions/setup-node@v4
- with:
- cache: yarn
- node-version: 20
-
- - name: Install packages and symlink local dependencies
- run: |
- yarn install --immutable --immutable-cache --check-cache
-
- - name: Lint
- run: |
- bundle exec rake lint
-
- audit:
- name: Audit dependencies
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Set up Ruby
- uses: ruby/setup-ruby@v1
- with:
- bundler-cache: true
-
- - name: Audit
- run: |
- bundle exec bundler-audit
+ tests:
+ name: Run Tests
+ uses: ./.github/workflows/run_tests.yml
aws_deploy:
name: AWS Deploy
- if: github.ref == 'refs/heads/main'
- needs: [lint, test, feature_test, requests_test, model_test, audit]
+ needs: [tests]
uses: ./.github/workflows/aws_deploy.yml
with:
aws_account_id: 107155005276
diff --git a/app/components/search_result_caption_component.html.erb b/app/components/search_result_caption_component.html.erb
index b8a9382b7..b2a28a505 100644
--- a/app/components/search_result_caption_component.html.erb
+++ b/app/components/search_result_caption_component.html.erb
@@ -7,7 +7,7 @@
<%= count %> <%= item_label.pluralize(count) %> matching filters
<% else %>
- <%= count %> total <%= item %>
+ <%= count %> total <%= item.pluralize(count) %>
<% end %>
diff --git a/app/views/bulk_upload_shared/uploads.html.erb b/app/views/bulk_upload_shared/uploads.html.erb
index 958887453..a9d134c60 100644
--- a/app/views/bulk_upload_shared/uploads.html.erb
+++ b/app/views/bulk_upload_shared/uploads.html.erb
@@ -1,4 +1,4 @@
-<% item_label = format_label(@pagy.count, "uploads") %>
+<% item_label = format_label(@pagy.count, "upload") %>
<% title = format_title(@searched, bulk_upload_title(controller.controller_name), current_user, item_label, @pagy.count, nil) %>
<% content_for :title, title %>
diff --git a/app/views/locations/index.html.erb b/app/views/locations/index.html.erb
index 23550f894..8ef5bcb56 100644
--- a/app/views/locations/index.html.erb
+++ b/app/views/locations/index.html.erb
@@ -32,7 +32,7 @@
count: @pagy.count,
item_label:,
total_count: @total_count,
- item: "locations",
+ item: "location",
filters_count: applied_filters_count(@filter_type),
)) %>
<% end %>
diff --git a/app/views/logs/_log_list.html.erb b/app/views/logs/_log_list.html.erb
index b5290c117..24714f247 100644
--- a/app/views/logs/_log_list.html.erb
+++ b/app/views/logs/_log_list.html.erb
@@ -1,7 +1,7 @@