Skip to content

Commit

Permalink
Merge pull request #17 from paulinebessoles/feat/add_tests_0_27
Browse files Browse the repository at this point in the history
Add tests to 0.27
  • Loading branch information
ferblape authored Sep 4, 2023
2 parents 6f94fa5 + 8fea559 commit 0fee03b
Show file tree
Hide file tree
Showing 61 changed files with 2,972 additions and 152 deletions.
47 changes: 0 additions & 47 deletions .circleci/config.yml

This file was deleted.

146 changes: 146 additions & 0 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: "[CI] ExtraUserFields"
on: "push"

env:
CI: "true"
RUBY_VERSION: 3.0.2
NODE_VERSION: 16.9.1

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-node@master
with:
node-version: ${{ env.NODE_VERSION }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true
- run: bundle exec rubocop -P
name: Lint Ruby files
- run: bundle exec erblint app/**/*.erb
name: Lint ERB files
tests:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:11
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
env:
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
steps:
- uses: rokroskar/[email protected]
if: "github.ref != 'refs/heads/develop'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/[email protected]
with:
fetch-depth: 1
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm get cache)-extra_user_fields"
- uses: actions/cache@v2
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-
- run: bundle exec rake test_app
name: Create test app
- run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots
name: Create the screenshots folder
- uses: nanasess/setup-chromedriver@v2
- run: RAILS_ENV=test bundle exec rails assets:precompile
name: Precompile assets
working-directory: ./spec/decidim_dummy_app/
- run: bundle exec rspec --exclude-pattern "spec/system/**/*_spec.rb"
name: RSpec
- uses: codecov/codecov-action@v1
- uses: actions/upload-artifact@v2
if: always()
with:
name: screenshots
path: ./spec/decidim_dummy_app/tmp/screenshots
if-no-files-found: ignore
system-tests:
name: System tests
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:11
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
env:
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
steps:
- uses: rokroskar/[email protected]
if: "github.ref != 'refs/heads/develop'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/[email protected]
with:
fetch-depth: 1
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm get cache)-extra_user_fields"
- uses: actions/cache@v2
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-
- run: bundle exec rake test_app
name: Create test app
- run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots
name: Create the screenshots folder
- uses: nanasess/setup-chromedriver@v2
- run: RAILS_ENV=test bundle exec rails assets:precompile
name: Precompile assets
working-directory: ./spec/decidim_dummy_app/
- run: bundle exec rspec spec/system
name: RSpec
- uses: codecov/codecov-action@v1
- uses: actions/upload-artifact@v2
if: always()
with:
name: screenshots
path: ./spec/decidim_dummy_app/tmp/screenshots
if-no-files-found: ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ spec/decidim_dummy_app

# default development application
development_app
.rubocop-https*-yml
20 changes: 20 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
inherit_from: https://raw.githubusercontent.com/decidim/decidim/release/0.27-stable/.rubocop.yml

AllCops:
Include:
- "**/*.rb"
- "**/*.rake"
- "**/*.ru"
- "**/Gemfile"
- "**/Rakefile"
Exclude:
- "development_app/**/*"
- "spec/decidim_dummy_app/**/*"
- "bin/**/*"
- "node_modules/**/*"
- "db/schema.rb"
- "vendor/**/*"

RSpec/FilePath:
Exclude:
- "spec/serializers/user_export_serializer_spec.rb"
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.2
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

DECIDIM_VERSION = "~> 0.27.3"
DECIDIM_VERSION = "~> 0.27.4"

source "https://rubygems.org"

Expand All @@ -12,7 +12,6 @@ gem "decidim-extra_user_fields", path: "."
gem "bootsnap", "~> 1.4"
gem "country_select", "~> 4.0"
gem "puma", ">= 4.3"
gem "rectify"

group :development, :test do
gem "byebug", "~> 11.0", platform: :mri
Expand All @@ -24,6 +23,7 @@ group :development do
gem "faker", "~> 2.14"
gem "letter_opener_web", "~> 1.3"
gem "listen", "~> 3.1"
gem "rubocop-faker"
gem "spring", "~> 2.0"
gem "spring-watcher-listen", "~> 2.0"
gem "web-console", "~> 3.5"
Expand Down
35 changes: 18 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PATH
specs:
decidim-extra_user_fields (0.27.2)
country_select (~> 4.0)
decidim-core (>= 0.26.0, < 0.28)
decidim-core (>= 0.27.0, < 0.28)
deface (~> 1.5)

GEM
Expand Down Expand Up @@ -510,7 +510,7 @@ GEM
tomlrb
mixlib-shellout (3.2.7)
chef-utils
msgpack (1.6.1)
msgpack (1.7.2)
multi_xml (0.6.0)
mustache (1.1.1)
net-imap (0.3.7)
Expand All @@ -525,6 +525,8 @@ GEM
nio4r (2.5.9)
nokogiri (1.14.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.14.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.14.5-x86_64-linux)
racc (~> 1.4)
oauth (1.1.0)
Expand Down Expand Up @@ -587,7 +589,7 @@ GEM
net-smtp
premailer (~> 1.7, >= 1.7.9)
public_suffix (5.0.3)
puma (5.6.5)
puma (5.6.7)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.8)
Expand Down Expand Up @@ -644,12 +646,6 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rectify (0.13.0)
activemodel (>= 4.1.0)
activerecord (>= 4.1.0)
activesupport (>= 4.1.0)
virtus (~> 1.0.5)
wisper (>= 1.6.1)
redcarpet (3.6.0)
redis (4.8.1)
regexp_parser (2.8.1)
Expand Down Expand Up @@ -701,6 +697,9 @@ GEM
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-faker (1.1.0)
faker (>= 2.12.0)
rubocop (>= 0.82.0)
rubocop-rails (2.15.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
Expand Down Expand Up @@ -735,7 +734,7 @@ GEM
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sixarm_ruby_unaccent (1.2.0)
sixarm_ruby_unaccent (1.2.2)
smart_properties (1.17.0)
snaky_hash (2.0.1)
hashie
Expand Down Expand Up @@ -793,7 +792,7 @@ GEM
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
webmock (3.18.1)
webmock (3.19.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand All @@ -808,7 +807,7 @@ GEM
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
wicked_pdf (2.6.3)
wicked_pdf (2.7.0)
activesupport
wisper (2.0.1)
wisper-rspec (1.1.0)
Expand All @@ -819,26 +818,28 @@ GEM

PLATFORMS
arm64-darwin-21
arm64-darwin-22
x86_64-darwin-20
x86_64-linux

DEPENDENCIES
bootsnap (~> 1.4)
byebug (~> 11.0)
country_select (~> 4.0)
decidim (~> 0.27.3)
decidim-dev (~> 0.27.3)
decidim (~> 0.27.4)
decidim-dev (~> 0.27.4)
decidim-extra_user_fields!
faker (~> 2.14)
letter_opener_web (~> 1.3)
listen (~> 3.1)
puma (>= 4.3)
rectify
rubocop-faker
spring (~> 2.0)
spring-watcher-listen (~> 2.0)
web-console (~> 3.5)

RUBY VERSION
ruby 3.0.6p216
ruby 3.0.2p107

BUNDLED WITH
2.3.26
2.3.19
Loading

0 comments on commit 0fee03b

Please sign in to comment.