Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3565a1d3
Commit
3565a1d3
authored
May 28, 2020
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add examples on how to run focused rspec
Warn against running all tests
parent
64edfb5c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
doc/development/testing_guide/best_practices.md
doc/development/testing_guide/best_practices.md
+10
-3
No files found.
doc/development/testing_guide/best_practices.md
View file @
3565a1d3
...
@@ -35,11 +35,18 @@ Here are some things to keep in mind regarding test performance:
...
@@ -35,11 +35,18 @@ Here are some things to keep in mind regarding test performance:
To run RSpec tests:
To run RSpec tests:
```
shell
```
shell
# run all tests
# run test for a file
bin/rspec spec/models/project_spec.rb
# run test for the example on line 10 on that file
bin/rspec spec/models/project_spec.rb:10
# run tests matching the example name has that string
bin/rspec spec/models/project_spec.rb
-e
associations
# run all tests, will take hours for GitLab codebase!
bin/rspec
bin/rspec
# run test for path
bin/rspec spec/[path]/[to]/[spec].rb
```
```
Use
[
Guard
](
https://github.com/guard/guard
)
to continuously monitor for changes and only run matching tests:
Use
[
Guard
](
https://github.com/guard/guard
)
to continuously monitor for changes and only run matching tests:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment