Skip to content
Open
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
22 changes: 6 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,10 @@ jobs:

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.gradle" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: gradle dependencies

- save_cache:
paths:
- ~/.gradle
key: v1-dependencies-{{ checksum "build.gradle" }}

# run tests!
- run: gradle test
# run tests and generate coverage report
- run: ./gradlew clean check jacocoTestReport

# upload code coverage report
# ultimately code coverage token shouldn't be in ci script of course
- run: bash <(curl -s https://codecov.io/bash) -t 5e7cd734-0897-43b4-9963-f4710f21ec64
5 changes: 5 additions & 0 deletions .codecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage:
status:
project:
default:
threshold: 0.5
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ hale-cli

[![Build Status](https://builds.wetransform.to/buildStatus/icon?job=hale/hale-cli~publish)](https://builds.wetransform.to/job/hale/job/hale-cli~publish)
[![Docker Hub Badge](https://img.shields.io/badge/Docker-Hub%20Hosted-blue.svg)](https://hub.docker.com/r/wetransform/hale-cli/)
[![codecov.io](http://codecov.io/github/sfrese/hale-cli/coverage.svg?branch=devel)](http://codecov.io/github/sfrese/hale-cli?branch=devel)

hale command line interface.
Lists available commands when run without arguments.
Expand Down
10 changes: 10 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ project.ext {

version = '3.5.0-SNAPSHOT'

// code coverage configuration
apply plugin: 'jacoco'
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}

/*
* Dependencies
*/
Expand Down Expand Up @@ -341,3 +350,4 @@ tasks.withType(CreateStartScripts).each { task ->
task wrapper(type: Wrapper) {
gradleVersion = '2.14'
}

Original file line number Diff line number Diff line change
Expand Up @@ -77,66 +77,4 @@ class RewriteCommandTest {
}
}

@Test
void testRewriteGuessSchema() {

def args = ['data', 'rewrite'];

args << '--data'
args << getClass().getClassLoader().getResource("testdata/inspire.gml")

def targetFile = File.createTempFile('rewrite', '.gml')
args << '--target'
args << targetFile.absolutePath
args << '--target-writer'
args << 'eu.esdihumboldt.hale.io.gml.writer'
args << '--target-setting'
args << 'xml.pretty=true'

try {
int code = new Runner('hale').run(args as String[])

// expecting a successful execution
assertEquals(0, code)

assertTrue(targetFile.exists())
assertTrue(targetFile.size() > 0)
//TODO check file content?

} finally {
targetFile.delete()
}
}

@Test
void testRewriteNoPassthrough() {

def args = ['data', 'rewrite'];

args << '--data'
args << getClass().getClassLoader().getResource("testdata/inspire.gml")

def targetFile = File.createTempFile('rewrite', '.gml')
args << '--target'
args << targetFile.absolutePath
args << '--target-writer'
args << 'eu.esdihumboldt.hale.io.wfs.fc.write-2.0'
args << '--target-setting'
args << 'skipFeatureCount=false'

try {
int code = new Runner('hale').run(args as String[])

// expecting a successful execution
assertEquals(0, code)

assertTrue(targetFile.exists())
assertTrue(targetFile.size() > 0)
//TODO check file content?

} finally {
targetFile.delete()
}
}

}