Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
Nextcloud Notify Push
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eduardo Trujillo
Nextcloud Notify Push
Commits
b3eee0ae
Commit
b3eee0ae
authored
3 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
make tests not hang?
Signed-off-by:
Robin Appelman
<
robin@icewind.nl
>
parent
ea93b6f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/integration.rs
+15
-13
15 additions, 13 deletions
tests/integration.rs
with
15 additions
and
13 deletions
tests/integration.rs
+
15
−
13
View file @
b3eee0ae
...
...
@@ -259,7 +259,7 @@ impl ServerHandle {
}
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_auth
()
{
let
services
=
Services
::
new
()
.await
;
services
.add_user
(
"foo"
,
"bar"
);
...
...
@@ -272,7 +272,7 @@ async fn test_auth() {
assert_next_message
(
&
mut
client
,
"authenticated"
)
.await
;
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_auth_failure
()
{
let
services
=
Services
::
new
()
.await
;
services
.add_user
(
"foo"
,
"bar"
);
...
...
@@ -302,12 +302,13 @@ async fn assert_next_message(
#[track_caller]
async
fn
assert_no_message
(
client
:
&
mut
WebSocketStream
<
MaybeTlsStream
<
TcpStream
>>
)
{
sleep
(
Duration
::
from_millis
(
5
))
.await
;
assert!
(
timeout
(
Duration
::
from_millis
(
10
),
client
.next
())
.await
.is_err
());
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_notify_activity
()
{
let
services
=
Services
::
new
()
.await
;
services
.add_user
(
"foo"
,
"bar"
);
...
...
@@ -322,9 +323,10 @@ async fn test_notify_activity() {
.unwrap
();
assert_next_message
(
&
mut
client
,
"notify_activity"
)
.await
;
std
::
mem
::
forget
(
services
);
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_notify_activity_other_user
()
{
let
services
=
Services
::
new
()
.await
;
services
.add_user
(
"foo"
,
"bar"
);
...
...
@@ -341,7 +343,7 @@ async fn test_notify_activity_other_user() {
assert_no_message
(
&
mut
client
)
.await
;
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_notify_file
()
{
let
services
=
Services
::
new
()
.await
;
services
.add_user
(
"foo"
,
"bar"
);
...
...
@@ -364,7 +366,7 @@ async fn test_notify_file() {
assert_next_message
(
&
mut
client
,
"notify_file"
)
.await
;
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_notify_file_different_storage
()
{
let
services
=
Services
::
new
()
.await
;
services
.add_user
(
"foo"
,
"bar"
);
...
...
@@ -387,7 +389,7 @@ async fn test_notify_file_different_storage() {
assert_no_message
(
&
mut
client
)
.await
;
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_notify_file_multiple
()
{
let
services
=
Services
::
new
()
.await
;
services
.add_user
(
"foo"
,
"bar"
);
...
...
@@ -421,7 +423,7 @@ async fn test_notify_file_multiple() {
assert_no_message
(
&
mut
client3
)
.await
;
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_pre_auth
()
{
let
services
=
Services
::
new
()
.await
;
...
...
@@ -446,7 +448,7 @@ async fn test_pre_auth() {
assert_next_message
(
&
mut
client
,
"notify_activity"
)
.await
;
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_notify_notification
()
{
let
services
=
Services
::
new
()
.await
;
services
.add_user
(
"foo"
,
"bar"
);
...
...
@@ -466,7 +468,7 @@ async fn test_notify_notification() {
assert_no_message
(
&
mut
client2
)
.await
;
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_notify_share
()
{
let
services
=
Services
::
new
()
.await
;
services
.add_user
(
"foo"
,
"bar"
);
...
...
@@ -486,7 +488,7 @@ async fn test_notify_share() {
assert_no_message
(
&
mut
client2
)
.await
;
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_notify_group
()
{
let
services
=
Services
::
new
()
.await
;
services
.add_user
(
"foo"
,
"bar"
);
...
...
@@ -509,7 +511,7 @@ async fn test_notify_group() {
assert_no_message
(
&
mut
client2
)
.await
;
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_notify_custom
()
{
let
services
=
Services
::
new
()
.await
;
services
.add_user
(
"foo"
,
"bar"
);
...
...
@@ -532,7 +534,7 @@ async fn test_notify_custom() {
assert_no_message
(
&
mut
client2
)
.await
;
}
#[tokio::test(flavor
=
"multi_thread"
)]
#[tokio::test(flavor
=
"multi_thread"
,
worker_threads
=
1
)]
async
fn
test_notify_custom_body
()
{
let
services
=
Services
::
new
()
.await
;
services
.add_user
(
"foo"
,
"bar"
);
...
...
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