Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkros1245 committed May 10, 2024
1 parent 6c1c461 commit b7a6b7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ jobs:
files: lcov.info
fail_ci_if_error: true

- name: Run simulator
run: cargo run
if: matrix.project == 'simulator'

- uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-review'
Expand Down
14 changes: 5 additions & 9 deletions simulator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ mod tests {
async fn generate_devices_test() {
let client = &mut make_client();
let amount_of_users = 10;
let min_amount_of_devices_per_user = 1;
let max_amount_of_devices_per_user = 3;
let amount_of_devices_per_user = 3;
let min_effect = 10.0;
let max_effect = 10000.0;

Expand All @@ -95,8 +94,7 @@ mod tests {
.expect("Could not create users for devices");

let device_ownership = data_factory::generate_devices(
min_amount_of_devices_per_user,
max_amount_of_devices_per_user,
amount_of_devices_per_user,
client,
&auth_tokens,
min_effect,
Expand All @@ -108,15 +106,14 @@ mod tests {
assert!(device_ownership.keys().count() == amount_of_users);
device_ownership
.values()
.for_each(|value| assert!(value.len() <= max_amount_of_devices_per_user));
.for_each(|value| assert!(value.len() == amount_of_devices_per_user));
}

#[tokio::test]
async fn generate_tasks_test() {
let client = &mut make_client();
let amount_of_users = 10;
let min_amount_of_devices_per_user = 1;
let max_amount_of_devices_per_user = 3;
let amount_of_devices_per_user = 3;
let min_amount_of_tasks_per_device = 1;
let max_amount_of_tasks_per_device = 3;
let min_effect = 10.0;
Expand All @@ -128,8 +125,7 @@ mod tests {
.await
.expect("Could not create users for devices");
let device_ownership = data_factory::generate_devices(
min_amount_of_devices_per_user,
max_amount_of_devices_per_user,
amount_of_devices_per_user,
client,
&auth_tokens,
min_effect,
Expand Down

0 comments on commit b7a6b7e

Please sign in to comment.