Add this line in file "config/application.rb" : config.active_record.schema_format = :sql
And, use development database for all opérations : export RAILS_ENV=test
And yet: bundle exec rake db:environment:set RAILS_ENV=test
Drop database, create database for core and all plugins : bundle exec rake db:drop db:create db:migrate redmine:plugins:migrate RAILS_ENV=test TESTOPTS="-v -w -b" --trace
First you can build fixtures with this command : bundle exec rake redmine:plugins:redmine_sla:build_fixture RAILS_ENV=test TESTOPTS="-v -w -b" --trace
Now, you can run the units tests: bundle exec rake redmine:plugins:test:units NAME=redmine_sla RAILS_ENV=test TESTOPTS="-v -w -b" --trace
NOTE: Unit tests are such as controller actions or SLA calculations.
But also functionals tests: bundle exec rake redmine:plugins:test:functionals NAME=redmine_sla RAILS_ENV=test TESTOPTS="-v -w -b" --trace
NOTE: Functional tests are particularly like access rights.
But also functionals tests: bundle exec rake redmine:plugins:test:system NAME=redmine_sla RAILS_ENV=test TESTOPTS="-v -w -b" --trace
NOTE: System tests use a headless browser.
TIP: Recommended use Chromium ( and chromium-driver ) with these options
**GOOGLE_CHROME_OPTS_ARGS = ["headless","disable-gpu","no-sandbox","disable-dev-shm-usage"]**
( intest/application_system_test_case.rb
file for example ).
And why not all the tests: bundle exec rake redmine:plugins:test NAME=redmine_sla RAILS_ENV=testTESTOPTS="-v -w -b" --trace
We suggest that you go see in the interface how the SLA are built with the comments in the section USECASE. To do this, you must use the definition of the « development » base for the « test » base ;) Or you have to force the execution of the tests on the development database.
NOTE: It's possible to reload default data after tests success :
bundle exec rake db:drop db:create db:migrate redmine:plugins:migrate redmine:load_default_data
Five users have been created by the fixtures, the logins of which are:
- admin
- manager
- developer ( only access to one project of TMA )
- sysadmin ( only access to two projects of infrastructure )
- reporter
- other
The password for each user is their login/name.
Here are the roles of the available users:
Name | is_admin | sla_manage | sla_view | Description |
---|---|---|---|---|
admin |
x | all this includes the SLA admin interface access | ||
manager |
x | x | View and manage SALs in projects | |
resolver |
x | Only sees SLAs in project tickets | ||
reporter |
Access projects without seeing SLAs in tickets | |||
other |
Don't access any projects |