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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
ec326254
Commit
ec326254
authored
Feb 20, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document Timecop usage for time-sensitive tests
parent
fbbbf1e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
doc/development/testing.md
doc/development/testing.md
+19
-0
No files found.
doc/development/testing.md
View file @
ec326254
...
@@ -95,6 +95,25 @@ so we need to set some guidelines for their use going forward:
...
@@ -95,6 +95,25 @@ so we need to set some guidelines for their use going forward:
[
lets-not
]:
https://robots.thoughtbot.com/lets-not
[
lets-not
]:
https://robots.thoughtbot.com/lets-not
### Time-sensitive tests
[
Timecop
](
https://github.com/travisjeffery/timecop
)
is available in our
Ruby-based tests for verifying things that are time-sensitive. Any test that
exercises or verifies something time-sensitive should make use of Timecop to
prevent transient test failures.
Example:
```
ruby
it
'is overdue'
do
issue
=
build
(
:issue
,
due_date:
Date
.
tomorrow
)
Timecop
.
freeze
(
3
.
days
.
from_now
)
do
expect
(
issue
).
to
be_overdue
end
end
```
### Test speed
### Test speed
GitLab has a massive test suite that, without parallelization, can take more
GitLab has a massive test suite that, without parallelization, can take more
...
...
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