Files
openproject/spec/AGENTS.md
2026-05-05 22:39:59 +03:00

982 B

Spec

Directory Structure

  • spec/features/ - System/feature tests (Capybara)
  • spec/models/ - Model unit tests
  • spec/requests/ - API/integration tests
  • spec/services/ - Service tests

Running Tests

# Backend (RSpec) - prefer specific tests over running all
bundle exec rspec spec/models/user_spec.rb              # Single file
bundle exec rspec spec/models/user_spec.rb:42           # Single line
bundle exec rspec spec/features                         # Directory
bundle exec rake parallel:spec                          # Parallel execution

Docker

bin/compose rspec spec/models/user_spec.rb   # Run specific tests in backend-test container
bin/compose exec backend bundle exec rspec    # Run tests directly in backend container

Debugging CI Failures

./script/github_pr_errors | xargs bundle exec rspec    # Run failed tests from CI
./script/bulk_run_rspec spec/path/to/flaky_spec.rb     # Run tests multiple times