Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc dart2 compat changes #18

Merged
merged 2 commits into from
Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@ services:
- rabbitmq
jobs:
include:
# - stage: run tests
# dart: stable
# script:
# - export PATH=$PATH:"~/.pub-cache/bin"
# - pub get
# - pub global activate coverage
# - dartanalyzer --fatal-warnings --fatal-hints --fatal-lints ./
# - cd test
# - bash run.sh
- stage: run tests
dart: dev
script:
Expand All @@ -21,6 +12,6 @@ jobs:
- dartanalyzer --fatal-warnings --fatal-hints --fatal-lints ./
- cd test
- bash run.sh
# after_success:
# - bash test_coverage.sh
# - bash <(curl -s https://codecov.io/bash) -X gcov -f '*.lcov'
after_success:
- bash test_coverage.sh
- dart upload_coverage.dart
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# dart_ampq

[![Build Status](https://travis-ci.org/achilleasa/dart_amqp.svg?branch=master)](https://travis-ci.org/achilleasa/dart_amqp)
[![codecov](https://codecov.io/gh/achilleasa/dart_amqp/branch/master/graph/badge.svg)](https://codecov.io/gh/achilleasa/dart_amqp)
[![Coverage Status](https://coveralls.io/repos/github/achilleasa/dart_amqp/badge.svg)](https://coveralls.io/github/achilleasa/dart_amqp)

Dart AMQP client implementing protocol version 0.9.1

Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies:
logging: ^0.11.3+2
dev_dependencies:
test: ^1.3.0
mock: ^0.12.0
mockito: ^3.0.0
http: ^0.11.1+1
xml: ^3.2.0
# coverage: ^0.12.2
# dart_codecov_generator: "^0.4.0"
coverage: ^0.12.2
coveralls: ^3.2.0
2 changes: 1 addition & 1 deletion test/lib/amqp_decoder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "dart:async";
import "dart:typed_data";

import "package:test/test.dart";
import "package:mock/mock.dart";
import "package:mockito/mockito.dart";

import "package:dart_amqp/src/enums.dart";
import "package:dart_amqp/src/protocol.dart";
Expand Down
4 changes: 2 additions & 2 deletions test/lib/auth_test.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
library dart_amqp.test.auth;

import "package:test/test.dart";
import "package:mock/mock.dart";
import "package:mockito/mockito.dart";

import "package:dart_amqp/src/authentication.dart";
import "package:dart_amqp/src/client.dart";
Expand Down Expand Up @@ -253,4 +253,4 @@ main({bool enableLogger : true}) {
}));
});
});
}
}
2 changes: 1 addition & 1 deletion test/lib/exception_handling_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "dart:async";
import "dart:math";

import "package:test/test.dart";
import "package:mock/mock.dart";
import "package:mockito/mockito.dart";

import "package:dart_amqp/src/client.dart";
import "package:dart_amqp/src/enums.dart";
Expand Down
2 changes: 1 addition & 1 deletion test/run_all.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ void main(List<String> args) {
if (runAll || (new RegExp("client")).hasMatch(allArgs)) {
client.main(enableLogger : enableLogger);
}
}
}
4 changes: 2 additions & 2 deletions test/test_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ dart --enable-vm-service --pause-isolates-on-exit run_all.dart > /dev/null &

# Run coverage collection tool
echo "Waiting for unit tests to run..."
collect_coverage --port=8181 -o coverage/coverage.json --wait-paused # --resume-isolates
pub global run coverage:collect_coverage --port=8181 -o coverage/coverage.json --wait-paused # --resume-isolates
echo "Collected coverage data..."

# Convert data to LCOV format
echo "Converting to LCOV format..."
format_coverage --package-root=../ -i coverage/coverage.json -l > coverage/coverage.lcov
pub global run coverage:format_coverage --package-root=../ -i coverage/coverage.json -l > coverage/coverage.lcov

# Remove LCOV blocks that do not belong to our project lib/ folder
echo "Filtering unrelated files from the LCOV data..."
Expand Down
14 changes: 14 additions & 0 deletions test/upload_coverage.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'dart:async';
import 'dart:io';
import 'package:coveralls/coveralls.dart';

Future<void> main() async {
try {
final coverage = File('coverage/coverage.lcov');
await Client().upload(await coverage.readAsString());
print('Code coverage report uploaded to coveralls.io');
} on Exception catch (err) {
print('An error occurred: $err');
if (err is ClientException) print('From: ${err.uri}');
}
}