Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
monitoring
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cylab
monitoring
Commits
defc6828
Commit
defc6828
authored
1 year ago
by
Thibault Debatty
Browse files
Options
Downloads
Patches
Plain Diff
clean test
parent
c957542e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#10871
failed
1 year ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/Unit/ExampleTest.php
+6
-7
6 additions, 7 deletions
tests/Unit/ExampleTest.php
with
6 additions
and
7 deletions
tests/Unit/ExampleTest.php
+
6
−
7
View file @
defc6828
...
...
@@ -253,14 +253,10 @@ class ExampleTest extends TestCase
// Insert a fake status change
$change
=
new
\App\StatusChange
();
$change
->
status
=
155
;
$change
->
status
=
\App\Status
::
ERROR
;
$change
->
server_id
=
$server_id
;
$change
->
save
();
// Run change detection
$change_detection_job
=
new
\App\Jobs\StatusChangeDetection
();
$change_detection_job
->
detectChangeForServer
(
$server
);
// Check if a new StatusChange was inserted in Mongo
$last_change
=
\App\StatusChange
::
getLastChangeForServer
(
$server_id
);
$records
=
$server
->
lastRecords1Day
();
...
...
@@ -268,12 +264,15 @@ class ExampleTest extends TestCase
$server
->
status
(
$records
)
->
code
(),
$last_change
->
status
);
// Run change detection
$change_detection_job
=
new
\App\Jobs\StatusChangeDetection
();
$change_detection_job
->
detectChangeForServer
(
$server
);
// Check if a notification w
ere
inserted
// Check if a notification w
as
inserted
$this
->
assertTrue
(
Notification
::
findForServer
(
$server_id
)
->
count
()
>
0
);
// Insert multiple status changes to simulate bouncing
for
(
$i
=
0
;
$i
<
4
;
$i
++
)
{
$change
=
new
\App\StatusChange
();
$change
->
status
=
155
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment