Use codecov for code coverage (#25)

* Use codecov for code coverage

* Change codacy coverage badge with codecov

* Unify repo badges

* Update download link

* Update unit tests
This commit is contained in:
Mikołaj Pich 2017-09-18 18:15:33 +02:00 committed by Rafał Borcz
parent 690b730494
commit aae3d5d357
9 changed files with 38 additions and 35 deletions

View File

@ -69,7 +69,10 @@ jobs:
name: Run Tests
command: ./gradlew --no-daemon --stacktrace test
- run:
name: Upload code coverage
name: Upload code coverage to codecov
command: ./gradlew --no-daemon --stacktrace jacocoTestReport && bash <(curl -s https://codecov.io/bash)
- run:
name: Upload code coverage to codacy
command: ./gradlew --no-daemon --stacktrace codacyUpload
- store_artifacts:
path: ./app/build/reports/tests/

View File

@ -1,11 +1,11 @@
# Wulkanowy
[![Codacy Grade Badge](https://api.codacy.com/project/badge/Grade/b0365aa6584a4c1abf36141204bc8de3)](https://www.codacy.com/app/wulkanowy/wulkanowy)
[![Codacy Coverage Badge](https://api.codacy.com/project/badge/Coverage/b0365aa6584a4c1abf36141204bc8de3)](https://www.codacy.com/app/wulkanowy/wulkanowy)
[![Build Status](https://www.bitrise.io/app/daeff1893f3c8128.svg?token=Hjm1ACamk86JDeVVJHOeqQ&branch=master)](https://www.bitrise.io/app/daeff1893f3c8128)
[![Codacy grade](https://img.shields.io/codacy/grade/b0365aa6584a4c1abf36141204bc8de3.svg?style=flat-square)](https://www.codacy.com/app/wulkanowy/wulkanowy)
[![Codecov](https://img.shields.io/codecov/c/github/wulkanowy/wulkanowy.svg?style=flat-square)](https://codecov.io/gh/wulkanowy/wulkanowy)
[![Dependency Status](https://www.versioneye.com/user/projects/5969ff0b0fb24f004f8c711b/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/5969ff0b0fb24f004f8c711b)
[![CircleCI](https://circleci.com/gh/wulkanowy/wulkanowy.svg?style=svg)](https://circleci.com/gh/wulkanowy/wulkanowy)
[![CircleCI](https://img.shields.io/circleci/project/github/wulkanowy/wulkanowy.svg?style=flat-square)](https://circleci.com/gh/wulkanowy/wulkanowy)
[![Build Status](https://www.bitrise.io/app/daeff1893f3c8128.svg?token=Hjm1ACamk86JDeVVJHOeqQ&branch=master)](https://www.bitrise.io/app/daeff1893f3c8128)
[Pobierz wersję rozwojową](https://www.bitrise.io/artifact/2280287/p/d79bc4af6825cb9f807b060d67a1c321)
[Pobierz wersję rozwojową](https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/master/artifacts/app-debug.apk)
Wulkanowy to projekt aplikacji na androida ułatwiającej używanie dziennika VULCANa.

View File

@ -56,7 +56,11 @@ public class GradesList extends Vulcan {
Pattern pattern = Pattern.compile("#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})");
Matcher matcher = pattern.matcher(row.select("td:nth-child(2) span.ocenaCzastkowa")
.attr("style"));
String color = matcher.find() ? matcher.group(1) : "";
String color = "";
while (matcher.find()) {
color = matcher.group(1);
}
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy", Locale.ROOT);
Date d = sdf.parse(row.select("td:nth-child(5)").text());

View File

@ -2,24 +2,12 @@ package io.github.wulkanowy.api.grades;
public class Subject {
private int id;
private String name;
private String predictedRating;
private String finalRating;
public int getId() {
return id;
}
public Subject setId(int id) {
this.id = id;
return this;
}
public String getName() {
return name;
}

View File

@ -200,9 +200,7 @@ public class Account {
myDao.update(this);
}
/**
* called by internal mechanisms, do not call yourself.
*/
/** called by internal mechanisms, do not call yourself. */
@Generated(hash = 1812283172)
public void __setDaoSession(DaoSession daoSession) {
this.daoSession = daoSession;

View File

@ -180,9 +180,7 @@ public class Subject {
myDao.update(this);
}
/**
* called by internal mechanisms, do not call yourself.
*/
/** called by internal mechanisms, do not call yourself. */
@Generated(hash = 937984622)
public void __setDaoSession(DaoSession daoSession) {
this.daoSession = daoSession;

View File

@ -10,7 +10,7 @@ import java.util.List;
import io.github.wulkanowy.dao.entities.Grade;
public class EntitiesCompareTest {
public class EntitiesCompareTest extends EntitiesCompare {
private List<Grade> newList = new ArrayList<>();

View File

@ -18,6 +18,7 @@ public class GradeTest {
Assert.assertEquals(R.color.one_grade, new Grade().setValue("1+").getValueColor());
Assert.assertEquals(R.color.one_grade, new Grade().setValue("+1").getValueColor());
Assert.assertEquals(R.color.default_grade, new Grade().setValue("Np").getValueColor());
Assert.assertEquals(R.color.default_grade, new Grade().setValue("7").getValueColor());
Assert.assertEquals(R.color.default_grade, new Grade().setValue("").getValueColor());
}
@ -31,5 +32,22 @@ public class GradeTest {
Assert.assertEquals(new Grade().setSubject("Religia").setValue("5").hashCode(),
new Grade().setSubject("Religia").setValue("5").hashCode());
Assert.assertFalse(new Grade().setSubject("Informatyka")
.equals(new FakeGrade().setSubject("Informatyka")));
Assert.assertFalse(new Grade().setSubject("Informatyka")
.equals(null));
}
private class FakeGrade {
private String subject;
private FakeGrade setSubject(String subject) {
this.subject = subject;
this.subject = this.subject + subject;
return this;
}
}
}

View File

@ -4,12 +4,8 @@ buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'https://maven.google.com'
}
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
@ -26,9 +22,7 @@ allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com'
}
maven { url 'https://maven.google.com' }
}
}