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

Set up CI and coverage #3

Merged
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
24 changes: 24 additions & 0 deletions .analysis_options
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
analyzer:
exclude:
- integrate/**
linter:
rules:
- annotate_overrides
- avoid_empty_else
- avoid_init_to_null
- avoid_return_types_on_setters
- camel_case_types
- empty_constructor_bodies
- hash_and_equals
- library_names
- library_prefixes
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_is_not_empty
- slash_for_doc_comments
- sort_constructors_first
- sort_unnamed_constructors_first
- type_init_formals
- unnecessary_brace_in_string_interp
- unnecessary_getters_setters
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: dart
dart:
- "1.17.1"
with_content_shell: true
before_install:
- export DISPLAY=:99.0
- ./tool/setup_dartium.sh
- export PATH=$PATH":$PWD"
- sh -e /etc/init.d/xvfb start
script:
- pub run dart_dev analyze
- pub run dart_dev test
- ./tool/generate_coverage.sh
- bash <(curl -s https://codecov.io/bash) -f coverage/coverage.lcov
3 changes: 3 additions & 0 deletions lib/src/component/aria_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ library over_react.aria_mixin;

import 'dart:collection';

// Must import these consts because they are used in the transformed code.
// ignore: unused_import
import 'package:over_react/over_react.dart' show PropDescriptor, ConsumedProps;
import 'package:over_react/src/component_declaration/annotations.dart';

/// Typed getters/setters for accessibility props.
Expand Down
3 changes: 3 additions & 0 deletions lib/src/component/prop_mixins.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
/// Various prop related mixins to be used with [UiComponent] descendants.
library over_react.prop_mixins;

// Must import these consts because they are used in the transformed code.
// ignore: unused_import
import 'package:over_react/over_react.dart' show PropDescriptor, ConsumedProps;
import 'package:over_react/src/component/callback_typedefs.dart';
import 'package:over_react/src/component_declaration/annotations.dart';

Expand Down
6 changes: 1 addition & 5 deletions lib/src/component/resize_sensor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class ResizeSensorComponent extends UiComponent<ResizeSensorProps> {

Element _expandSensorChildRef;
Element _expandSensorRef;
Element _collapseSensorChildRef;
Element _collapseSensorRef;

@override
Expand Down Expand Up @@ -115,10 +114,7 @@ class ResizeSensorComponent extends UiComponent<ResizeSensorProps> {
..key = 'expandSensor'
)(expandSensorChild);

var collapseSensorChild = (Dom.div()
..ref = (ref) { _collapseSensorChildRef = ref; }
..style = _collapseSensorChildStyle
)();
var collapseSensorChild = (Dom.div()..style = _collapseSensorChildStyle)();

var collapseSensor = (Dom.div()
..className = 'resize-sensor-collapse'
Expand Down
3 changes: 3 additions & 0 deletions lib/src/util/class_names.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ library over_react.class_names;

import 'dart:collection';

// Must import these consts because they are used in the transformed code.
// ignore: unused_import
import 'package:over_react/over_react.dart' show PropDescriptor, ConsumedProps;
import 'package:over_react/src/component_declaration/annotations.dart';

/// Typed getters/setters for props related to CSS class manipulation, and used by all UIP components.
Expand Down
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: over_react
publish_to: https://pub.workiva.org
version: 1.0.0
description: A library for building statically-typed React UI components using Dart.
homepage: https://github.com/Workiva/over_react/
Expand Down
1 change: 0 additions & 1 deletion tool/dev.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import 'package:dart_dev/dart_dev.dart' show dev, config;
main(List<String> args) async {
const directories = const <String>[
'lib/',
'example/',
'test/',
'tool/',
];
Expand Down
4 changes: 4 additions & 0 deletions tool/generate_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

# DART_FLAGS has to be set to `--checked` because dart_dev does not run tests in checked mode.
DART_FLAGS=--checked pub run dart_dev coverage --no-html --no-open
27 changes: 27 additions & 0 deletions tool/setup_dartium.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -e

DARTIUM_DIST="dartium-linux-x64-release.zip";
echo "Installing Dartium
"
curl "http://storage.googleapis.com/dart-archive/channels/stable/raw/latest/dartium/$DARTIUM_DIST" > $DARTIUM_DIST
unzip -u $DARTIUM_DIST > /dev/null
rm $DARTIUM_DIST
mv dartium-* dartiumdir
export DARTIUM_BIN="$PWD/dartiumdir/chrome"

SELENIUM_JAR="selenium-server.jar";
echo "Installing Selenium"
curl "http://selenium-release.storage.googleapis.com/2.48/selenium-server-standalone-2.48.2.jar" > $SELENIUM_JAR
echo "#!/usr/bin/env bash" | tee -a selenium-server
echo "exec java -jar $PWD/$SELENIUM_JAR \"$@\"" | tee -a selenium-server
chmod +x selenium-server

CHROMEDRIVER="chromedriver.zip";
echo "Installing Chromedriver"
curl "http://chromedriver.storage.googleapis.com/2.14/chromedriver_linux64.zip" > $CHROMEDRIVER
unzip $CHROMEDRIVER
chmod +x chromedriver
ln -s "$PWD/dartiumdir/chrome" "$PWD/dartium"

export PATH=$PATH":$PWD"