Browse Source

Merge pull request #161 from provokateurin/fix/unit-tests-performance

Fix unit tests performance
pull/163/head
Kate 2 years ago committed by GitHub
parent
commit
d1a1ee2802
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      packages/nextcloud/test/helper.dart
  2. 4
      packages/nextcloud/test/webdav.dart
  3. 3
      tool/Dockerfile.dev

14
packages/nextcloud/test/helper.dart

@ -36,12 +36,14 @@ class DockerContainer {
} }
} }
Future destroy() => runExecutableArguments( void destroy() => unawaited(
'docker', runExecutableArguments(
[ 'docker',
'kill', [
id, 'kill',
], id,
],
),
); );
Future<String> collectLogs() async { Future<String> collectLogs() async {

4
packages/nextcloud/test/webdav.dart

@ -49,7 +49,7 @@ Future run(final DockerImage image) async {
final file = files.singleWhere((final f) => f.name == 'Nextcloud.png'); final file = files.singleWhere((final f) => f.name == 'Nextcloud.png');
expect(file.hasPreview, isTrue); expect(file.hasPreview, isTrue);
expect(file.mimeType, 'image/png'); expect(file.mimeType, 'image/png');
expectDateInReasonableTimeRange(file.lastModified!, DateTime.now()); expect(file.lastModified!.isBefore(DateTime.now()), isTrue);
expect(file.size!, 50598); expect(file.size!, 50598);
}); });
@ -168,7 +168,7 @@ Future run(final DockerImage image) async {
); );
expect(file.hasPreview, isTrue); expect(file.hasPreview, isTrue);
expect(file.mimeType, 'image/png'); expect(file.mimeType, 'image/png');
expectDateInReasonableTimeRange(file.lastModified!, DateTime.now()); expect(file.lastModified!.isBefore(DateTime.now()), isTrue);
expect(file.size!, 50598); expect(file.size!, 50598);
}); });

3
tool/Dockerfile.dev

@ -15,4 +15,7 @@ RUN ./occ app:install news
RUN ./occ app:install notes RUN ./occ app:install notes
RUN ./occ app:enable password_policy RUN ./occ app:enable password_policy
RUN (bash /entrypoint.sh apache2-foreground &) && \
until curl -s -o /dev/null http://localhost/status.php; do true; done && \
for user in admin user1 user2; do curl -u "$user:$user" -H "ocs-apirequest: true" -s -o /dev/null http://localhost/ocs/v2.php/cloud/user; done
COPY --chown=www-data:www-data overlay /usr/src/nextcloud/ COPY --chown=www-data:www-data overlay /usr/src/nextcloud/

Loading…
Cancel
Save