fix: coverage_without_olm tests
The coverage calculation is currently broken in dart/test, see https://github.com/dart-lang/test/issues/1698 for reference.
This commit is contained in:
parent
f08d38ef6d
commit
4ac1615ad6
|
|
@ -50,17 +50,17 @@ coverage_without_olm:
|
||||||
script:
|
script:
|
||||||
- dart pub get
|
- dart pub get
|
||||||
- ./scripts/test.sh
|
- ./scripts/test.sh
|
||||||
coverage: /^\s*lines\.*:\s*\d+.\d+\%/
|
#coverage: /^\s*lines\.*:\s*\d+.\d+\%/ <- broken see https://github.com/dart-lang/test/issues/1698
|
||||||
artifacts:
|
artifacts:
|
||||||
when: always
|
when: always
|
||||||
paths:
|
paths:
|
||||||
- coverage/
|
#- coverage/
|
||||||
- coverage.xml
|
#- coverage.xml
|
||||||
- TEST-report.xml
|
- TEST-report.xml
|
||||||
reports:
|
reports:
|
||||||
coverage_report:
|
#coverage_report:
|
||||||
coverage_format: cobertura
|
# coverage_format: cobertura
|
||||||
path: coverage.xml
|
# path: coverage.xml
|
||||||
junit: TEST-report.xml
|
junit: TEST-report.xml
|
||||||
|
|
||||||
e2ee_test:
|
e2ee_test:
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,9 @@ if which flutter >/dev/null; then
|
||||||
flutter pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$'
|
flutter pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$'
|
||||||
else
|
else
|
||||||
dart pub global activate junitreport
|
dart pub global activate junitreport
|
||||||
dart test --coverage=coverage --file-reporter='json:TEST-report.json'
|
# Test coverage using dart only is broken: https://github.com/dart-lang/test/issues/1698
|
||||||
|
#dart test --coverage=coverage --file-reporter='json:TEST-report.json'
|
||||||
|
dart test --file-reporter='json:TEST-report.json'
|
||||||
TEST_CODE=$?
|
TEST_CODE=$?
|
||||||
|
|
||||||
# junit report
|
# junit report
|
||||||
|
|
@ -22,15 +24,15 @@ else
|
||||||
# remove shell escapes since those are invalid xml
|
# remove shell escapes since those are invalid xml
|
||||||
sed 's///g' -i TEST-report.xml
|
sed 's///g' -i TEST-report.xml
|
||||||
|
|
||||||
# coverage
|
# coverage -> broken see https://github.com/dart-lang/test/issues/1698
|
||||||
dart pub global activate coverage
|
#dart pub global activate coverage
|
||||||
|
|
||||||
reporton="--report-on=lib/"
|
#reporton="--report-on=lib/"
|
||||||
if [ -n "$NO_OLM" ]; then reporton="--report-on=lib/src --report-on=lib/msc_extensions"; fi
|
#if [ -n "$NO_OLM" ]; then reporton="--report-on=lib/src --report-on=lib/msc_extensions"; fi
|
||||||
|
|
||||||
dart pub global run coverage:format_coverage -i coverage/ --lcov -o coverage/lcov.info $reporton
|
#dart pub global run coverage:format_coverage -i coverage/ --lcov -o coverage/lcov.info $reporton
|
||||||
dart pub global activate remove_from_coverage
|
#dart pub global activate remove_from_coverage
|
||||||
dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$'
|
#dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# coverage html report
|
# coverage html report
|
||||||
|
|
|
||||||
|
|
@ -255,10 +255,5 @@ void main() {
|
||||||
if (!olmEnabled) return;
|
if (!olmEnabled) return;
|
||||||
await client.dispose(closeDatabase: true);
|
await client.dispose(closeDatabase: true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -117,10 +117,5 @@ void main() {
|
||||||
if (!olmEnabled) return;
|
if (!olmEnabled) return;
|
||||||
await client.dispose(closeDatabase: true);
|
await client.dispose(closeDatabase: true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,10 +102,5 @@ void main() {
|
||||||
if (!olmEnabled) return;
|
if (!olmEnabled) return;
|
||||||
await client.dispose(closeDatabase: true);
|
await client.dispose(closeDatabase: true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,10 +120,5 @@ void main() {
|
||||||
await client.dispose(closeDatabase: true);
|
await client.dispose(closeDatabase: true);
|
||||||
await otherClient.dispose(closeDatabase: true);
|
await otherClient.dispose(closeDatabase: true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -572,10 +572,5 @@ void main() {
|
||||||
if (!olmEnabled) return;
|
if (!olmEnabled) return;
|
||||||
await client.dispose(closeDatabase: false);
|
await client.dispose(closeDatabase: false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -400,10 +400,5 @@ void main() {
|
||||||
|
|
||||||
await matrix.dispose(closeDatabase: true);
|
await matrix.dispose(closeDatabase: true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,7 @@ void main() async {
|
||||||
true);
|
true);
|
||||||
await client1.encryption!.keyVerificationManager.cleanup();
|
await client1.encryption!.keyVerificationManager.cleanup();
|
||||||
await client2.encryption!.keyVerificationManager.cleanup();
|
await client2.encryption!.keyVerificationManager.cleanup();
|
||||||
}, skip: skip);
|
});
|
||||||
|
|
||||||
test('ask SSSS start', () async {
|
test('ask SSSS start', () async {
|
||||||
client1.userDeviceKeys[client1.userID]!.masterKey!
|
client1.userDeviceKeys[client1.userID]!.masterKey!
|
||||||
|
|
@ -257,7 +257,7 @@ void main() async {
|
||||||
|
|
||||||
await req1.cancel();
|
await req1.cancel();
|
||||||
await client1.encryption!.keyVerificationManager.cleanup();
|
await client1.encryption!.keyVerificationManager.cleanup();
|
||||||
}, skip: skip);
|
});
|
||||||
|
|
||||||
test('ask SSSS end', () async {
|
test('ask SSSS end', () async {
|
||||||
FakeMatrixApi.calledEndpoints.clear();
|
FakeMatrixApi.calledEndpoints.clear();
|
||||||
|
|
@ -379,7 +379,7 @@ void main() async {
|
||||||
|
|
||||||
await client1.encryption!.keyVerificationManager.cleanup();
|
await client1.encryption!.keyVerificationManager.cleanup();
|
||||||
await client2.encryption!.keyVerificationManager.cleanup();
|
await client2.encryption!.keyVerificationManager.cleanup();
|
||||||
}, skip: skip);
|
});
|
||||||
|
|
||||||
test('reject verification', () async {
|
test('reject verification', () async {
|
||||||
FakeMatrixApi.calledEndpoints.clear();
|
FakeMatrixApi.calledEndpoints.clear();
|
||||||
|
|
@ -412,7 +412,7 @@ void main() async {
|
||||||
|
|
||||||
await client1.encryption!.keyVerificationManager.cleanup();
|
await client1.encryption!.keyVerificationManager.cleanup();
|
||||||
await client2.encryption!.keyVerificationManager.cleanup();
|
await client2.encryption!.keyVerificationManager.cleanup();
|
||||||
}, skip: skip);
|
});
|
||||||
|
|
||||||
test('reject sas', () async {
|
test('reject sas', () async {
|
||||||
FakeMatrixApi.calledEndpoints.clear();
|
FakeMatrixApi.calledEndpoints.clear();
|
||||||
|
|
@ -488,7 +488,7 @@ void main() async {
|
||||||
|
|
||||||
await client1.encryption!.keyVerificationManager.cleanup();
|
await client1.encryption!.keyVerificationManager.cleanup();
|
||||||
await client2.encryption!.keyVerificationManager.cleanup();
|
await client2.encryption!.keyVerificationManager.cleanup();
|
||||||
}, skip: skip);
|
});
|
||||||
|
|
||||||
test('other device accepted', () async {
|
test('other device accepted', () async {
|
||||||
FakeMatrixApi.calledEndpoints.clear();
|
FakeMatrixApi.calledEndpoints.clear();
|
||||||
|
|
@ -536,11 +536,6 @@ void main() async {
|
||||||
'/client/v3/rooms/!1234%3AfakeServer.notExisting/send/m.key.verification.cancel'));
|
'/client/v3/rooms/!1234%3AfakeServer.notExisting/send/m.key.verification.cancel'));
|
||||||
await client1.encryption!.keyVerificationManager.cleanup();
|
await client1.encryption!.keyVerificationManager.cleanup();
|
||||||
await client2.encryption!.keyVerificationManager.cleanup();
|
await client2.encryption!.keyVerificationManager.cleanup();
|
||||||
}, skip: skip);
|
});
|
||||||
|
}, skip: skip);
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
}, skip: skip != 'false' ? 'false' : 'No need for dummy');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -264,10 +264,5 @@ void main() {
|
||||||
if (!olmEnabled) return;
|
if (!olmEnabled) return;
|
||||||
await client.dispose(closeDatabase: true);
|
await client.dispose(closeDatabase: true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -120,10 +120,5 @@ void main() {
|
||||||
if (!olmEnabled) return;
|
if (!olmEnabled) return;
|
||||||
await client.dispose(closeDatabase: false);
|
await client.dispose(closeDatabase: false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -496,10 +496,5 @@ void main() {
|
||||||
if (!olmEnabled) return;
|
if (!olmEnabled) return;
|
||||||
await client.dispose(closeDatabase: true);
|
await client.dispose(closeDatabase: true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,10 +73,5 @@ void main() {
|
||||||
expect(shrinkedImage.blurhash, 'L75NyU5kvvbx^7AF#kSgZxOZ%5NE',
|
expect(shrinkedImage.blurhash, 'L75NyU5kvvbx^7AF#kSgZxOZ%5NE',
|
||||||
reason: 'Unexpected scaled image blur');
|
reason: 'Unexpected scaled image blur');
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(seconds: 1));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1662,10 +1662,5 @@ void main() {
|
||||||
expect(event.onlyEmotes, false);
|
expect(event.onlyEmotes, false);
|
||||||
expect(event.numberEmotes, 2);
|
expect(event.numberEmotes, 2);
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(milliseconds: 400));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,5 @@ void main() {
|
||||||
expect(data.tryGet<Map<String, dynamic>>('pam')?.tryGet<String>('beep'),
|
expect(data.tryGet<Map<String, dynamic>>('pam')?.tryGet<String>('beep'),
|
||||||
null);
|
null);
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(milliseconds: 400));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,10 +65,5 @@ void main() {
|
||||||
);
|
);
|
||||||
expect(matrixException.error, MatrixError.M_UNKNOWN);
|
expect(matrixException.error, MatrixError.M_UNKNOWN);
|
||||||
});
|
});
|
||||||
|
|
||||||
// see https://github.com/dart-lang/test/issues/1698
|
|
||||||
test('KeyVerification dummy test', () async {
|
|
||||||
await Future.delayed(Duration(milliseconds: 400));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue