You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RUNNING_TESTS 3.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. Installing gems for testing
  2. ===========================
  3. Remove your .bundle/config if you've already installed Redmine without
  4. the test dependencies. Then, run `bundle install`.
  5. Running Tests
  6. =============
  7. Run `rake --tasks test` to see available tests.
  8. Run `rake test` to run the entire test suite (except the tests for the
  9. Apache perl module Redmine.pm and Capybara tests, see below).
  10. You can run `ruby test/unit/issue_test.rb` for running a single test case and
  11. `ruby test/unit/issue_test.rb -n test_create` for running a single test.
  12. Before running tests, you need to configure both development
  13. and test databases.
  14. Creating test repositories
  15. ==========================
  16. Redmine supports a wide array of different version control systems.
  17. To test the support, a test repository needs to be created for each of those.
  18. Run `rake --tasks test:scm:setup` for a list of available test-repositories or
  19. run `rake test:scm:setup:all` to set up all of them. The repositories are
  20. unpacked into {redmine_root}/tmp/test.
  21. If the test repositories are not present, the tests that need them will be
  22. skipped.
  23. Creating a test LDAP database
  24. =============================
  25. Redmine supports using LDAP for user authentications. To test LDAP
  26. with Redmine, load the LDAP export from test/fixtures/ldap/test-ldap.ldif
  27. into a testing LDAP server. Make sure that the LDAP server can be accessed
  28. at 127.0.0.1 on port 389.
  29. If your LDAP server is not running on localhost, you can use the
  30. REDMINE_TEST_LDAP_SERVER environment variable to specify another host.
  31. Setting up the test LDAP server is beyond the scope of this documentation.
  32. The OpenLDAP project provides a simple LDAP implementation that should work
  33. good as a test server.
  34. If the LDAP is not available, the tests that need it will be skipped.
  35. Running Redmine.pm tests
  36. ========================
  37. (work in progress)
  38. Running the tests for the Redmine.pm perl module needs a bit more setup.
  39. You need an Apache server with mod_perl, mod_dav_svn and Redmine.pm configured.
  40. See: http://www.redmine.org/projects/redmine/wiki/Repositories_access_control_with_apache_mod_dav_svn_and_mod_perl
  41. You need an empty repository accessible at http://127.0.0.1/svn/ecookbook
  42. Then, you can run the tests with:
  43. `ruby test\extra\redmine_pm\repository_subversion_test.rb`
  44. If your svn server is not running on localhost, you can use the
  45. REDMINE_TEST_DAV_SERVER environment variable to specify another host.
  46. Running Capybara tests
  47. ======================
  48. You need to have ChromeDriver installed and available in your PATH:
  49. https://sites.google.com/a/chromium.org/chromedriver/
  50. Capybara tests can be run with:
  51. `rails test:system`
  52. Running RuboCop, a static code analyzer
  53. =======================================
  54. RuboCop allows you to find out if the code violates the Ruby Style Guide.
  55. Checking with RuboCop is recommended when you write patches.
  56. You can run RuboCop with:
  57. `bundle exec rubocop [file ...]`
  58. Running Stylelint, a static code analyzer for CSS files
  59. =======================================
  60. You need to have NodeJS and Yarn installed and available in your PATH:
  61. https://nodejs.org/en/download/package-manager/
  62. https://legacy.yarnpkg.com/lang/en/docs/install/#mac-stable
  63. Install Stylelint:
  64. `yarn install`
  65. You can run Stylelint with:
  66. `node_modules/.bin/stylelint "public/stylesheets/**/*.css"`