Skip to content

Commit

Permalink
test(dynamite_end_to_end_test,nextcloud): migrate to dart test config…
Browse files Browse the repository at this point in the history
…uration

Signed-off-by: Nikolas Rimikis <[email protected]>
  • Loading branch information
Leptopoda committed Oct 26, 2023
1 parent ab10025 commit b11f9f8
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ jobs:
if [ -z "$packages" ]; then exit 0; fi
packages_glob="$(printf ",%s" "${packages[@]}")"
packages_glob="${packages_glob:1}"
melos exec --scope="$packages_glob" --concurrency=1 --fail-fast --dir-exists=test -- "flutter test --concurrency=$(nproc --all)"
melos exec --scope="$packages_glob" --concurrency=1 --fail-fast --dir-exists=test -- "flutter test --concurrency=$(nproc --all) -x source_verification"
melos exec --scope="$packages_glob" --concurrency=1 --fail-fast --dir-exists=test -- "flutter test --concurrency=1 -t source_verification"
4 changes: 4 additions & 0 deletions dart_test_base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
timeout: 30s
tags:
integration: { retry: 3 }
source_verification: { timeout: 20x } # 10m
3 changes: 2 additions & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ scripts:
format: dart format --fix --line-length 120 .
format:check: dart format --output=none --set-exit-if-changed --line-length 120 .
analyze: dart analyze --fatal-infos .
test: melos exec --concurrency=1 --fail-fast --dir-exists=test -- "flutter test --concurrency=$(nproc --all)"
test: melos exec --concurrency=1 --fail-fast --dir-exists=test -- "flutter test --concurrency=$(nproc --all) -x source_verification -x integration"
test:source_verification: melos exec --concurrency=1 --fail-fast --dir-exists=test -- "flutter test --concurrency=1 -t source_verification"
generate:neon:build_runner: melos exec --scope="neon*" --file-exists="build.yaml" -- dart run build_runner build --delete-conflicting-outputs && melos run format
generate:neon:l10n: melos exec --flutter --dir-exists="lib/l10n" flutter gen-l10n && melos run format
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:build_verify/build_verify.dart';
import 'package:test/test.dart';

Expand All @@ -8,6 +10,7 @@ void main() {
packageRelativeDirectory: 'packages/dynamite/dynamite_end_to_end_test',
customCommand: ['bash', 'generate.sh'],
),
timeout: const Timeout.factor(2),
tags: 'source_verification',
skip: !Platform.environment.containsKey('GITHUB_REPOSITORY'),
);
}
1 change: 1 addition & 0 deletions packages/nextcloud/dart_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: ../../dart_test_base.yaml
3 changes: 1 addition & 2 deletions packages/nextcloud/test/core_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ void main() {
);
});
},
retry: retryCount,
timeout: timeout,
tags: 'integration',
);
}
3 changes: 1 addition & 2 deletions packages/nextcloud/test/dashboard_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ void main() {
});
});
},
retry: retryCount,
timeout: timeout,
tags: 'integration',
);
}
3 changes: 0 additions & 3 deletions packages/nextcloud/test/helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import 'package:nextcloud/nextcloud.dart';
import 'package:process_run/cmd_run.dart';
import 'package:test/test.dart';

const retryCount = 3;
const timeout = Timeout(Duration(seconds: 30));

class DockerContainer {
DockerContainer({
required this.id,
Expand Down
3 changes: 1 addition & 2 deletions packages/nextcloud/test/news_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ void main() {
expect(response.body.items, hasLength(0));
});
},
retry: retryCount,
timeout: timeout,
tags: 'integration',
);
}

Expand Down
3 changes: 1 addition & 2 deletions packages/nextcloud/test/notes_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ void main() {
expect(response.body.noteMode, notes.Settings_NoteMode.preview);
});
},
retry: retryCount,
timeout: timeout,
tags: 'integration',
);
}
3 changes: 1 addition & 2 deletions packages/nextcloud/test/notifications_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ void main() {
await client.notifications.push.removeDevice();
});
},
retry: retryCount,
timeout: timeout,
tags: 'integration',
);
}
3 changes: 1 addition & 2 deletions packages/nextcloud/test/provisioning_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ void main() {
});
});
},
retry: retryCount,
timeout: timeout,
tags: 'integration',
);
}
3 changes: 1 addition & 2 deletions packages/nextcloud/test/uppush_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ void main() {

// Deleting an app, sending a notification (also via matrix gateway) or listening for notifications is not possible because redis is not set up
},
retry: retryCount,
timeout: timeout,
tags: 'integration',
);
}
3 changes: 1 addition & 2 deletions packages/nextcloud/test/user_status_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ void main() {
expect(response.body.ocs.data.statusIsUserDefined, false);
});
},
retry: retryCount,
timeout: timeout,
tags: 'integration',
);
}
3 changes: 1 addition & 2 deletions packages/nextcloud/test/webdav_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ void main() {
// props: Most of them are either not applicable or hard/impossible to implement because we don't allow just writing any props
});
},
retry: retryCount,
timeout: timeout,
tags: 'integration',
);
}

0 comments on commit b11f9f8

Please sign in to comment.