Skip to content

Commit a79ff43

Browse files
committed
Merge branch 'development-docs-from-gdk' into 'master'
Add 'run tests' development docs from GDK This adds some documentation that lived in https://gitlab.com/gitlab-org/gitlab-development-kit but which belongs more in here. See merge request !5684
2 parents aa49c20 + ef58921 commit a79ff43

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

doc/development/rake_tasks.md

+26-4
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,33 @@ Note: `db:setup` calls `db:seed` but this does nothing.
1414

1515
## Run tests
1616

17-
This runs all test suites present in GitLab.
17+
In order to run the test you can use the following commands:
18+
- `rake spinach` to run the spinach suite
19+
- `rake spec` to run the rspec suite
20+
- `rake teaspoon` to run the teaspoon test suite
21+
- `rake gitlab:test` to run all the tests
1822

19-
```
20-
bundle exec rake test
21-
```
23+
Note: Both `rake spinach` and `rake spec` takes significant time to pass.
24+
Instead of running full test suite locally you can save a lot of time by running
25+
a single test or directory related to your changes. After you submit merge request
26+
CI will run full test suite for you. Green CI status in the merge request means
27+
full test suite is passed.
28+
29+
Note: You can't run `rspec .` since this will try to run all the `_spec.rb`
30+
files it can find, also the ones in `/tmp`
31+
32+
To run a single test file you can use:
33+
34+
- `bundle exec rspec spec/controllers/commit_controller_spec.rb` for a rspec test
35+
- `bundle exec spinach features/project/issues/milestones.feature` for a spinach test
36+
37+
To run several tests inside one directory:
38+
39+
- `bundle exec rspec spec/requests/api/` for the rspec tests if you want to test API only
40+
- `bundle exec spinach features/profile/` for the spinach tests if you want to test only profile pages
41+
42+
If you want to use [Spring](https://github.com/rails/spring) set
43+
`ENABLE_SPRING=1` in your environment.
2244

2345
## Generate searchable docs for source code
2446

0 commit comments

Comments
 (0)