Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Add coveralls support (#8)
Browse files Browse the repository at this point in the history
* Add coveralls support
  • Loading branch information
cam-stitt authored Mar 7, 2018
1 parent afb79f2 commit 662f9e4
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ before_install:
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
# Make the binary executable
- chmod +x $GOPATH/bin/dep
- go get github.com/mattn/goveralls
- go get github.com/modocache/gover

install:
- dep ensure
script:
- go test -race -v ./...
- ./coveralls.sh
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Build Status](https://travis-ci.org/openpixel/rise.svg?branch=master)](https://travis-ci.org/openpixel/rise)
[![Go Report Card](https://goreportcard.com/badge/github.com/openpixel/rise)](https://goreportcard.com/report/github.com/openpixel/rise)
[![Docs](https://readthedocs.org/projects/risecli/badge/?version=latest)](https://risecli.readthedocs.io/en/latest/?badge=latest)
[![GoDoc](https://godoc.org/github.com/openpixel/rise?status.svg)](https://godoc.org/github.com/openpixel/rise)
[![Coverage Status](https://coveralls.io/repos/github/openpixel/rise/badge.svg?branch=master)](https://coveralls.io/github/openpixel/rise?branch=master)

# rise

Expand All @@ -16,7 +17,7 @@ You can find binaries for the latest release on the [releases](https://github.co

### Go toolchain

```
```bash
$ go get -u github.com/openpixel/rise
```

Expand All @@ -25,7 +26,7 @@ $ go get -u github.com/openpixel/rise
### CLI
You can see the usage documentation for the CLI by running `rise --help`.

```
```bash
$ rise --help
A powerful text interpolation tool.

Expand All @@ -49,22 +50,22 @@ Flags:
The config files should be in hcl compatible formats. See https://github.com/hashicorp/hcl for reference. Rise loads the files using FIFO, meaning the last file to reference a key will take precedence. For example, if we had two files that looked like this:

vars.hcl
```
```hcl
variable "i" {
value = 6
}
```

vars2.hcl
```
```hcl
variable "i" {
value = 10
}
```

And ran the following command

```
```bash
$ rise ... --config vars.hcl --config vars2.hcl
```

Expand All @@ -74,7 +75,7 @@ The value of `i` would be `10`.

Look in the [examples](https://github.com/OpenPixel/rise/tree/master/examples) directory for an example, including inheritance:

```
```bash
$ rise -i ./examples/input.json -o ./examples/output.json --config ./examples/vars.hcl --config ./examples/vars2.hcl
```

Expand Down
30 changes: 30 additions & 0 deletions coveralls.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

if ! type -P gover
then
echo gover missing: go get github.com/modocache/gover
exit 1
fi

if ! type -P goveralls
then
echo goveralls missing: go get github.com/mattn/goveralls
exit 1
fi

if [[ "$COVERALLS_TOKEN" == "" ]]
then
echo COVERALLS_TOKEN not set
exit 1
fi

go list ./... | cut -d'/' -f 4- | while read d
do
cd $d
go test -covermode count -coverprofile coverage.coverprofile
cd -
done

gover
goveralls -coverprofile gover.coverprofile -service travis-ci -repotoken $COVERALLS_TOKEN
find . -name '*.coverprofile' -delete
6 changes: 3 additions & 3 deletions interpolation/strings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,17 @@ func TestInterpolationFuncJoin(t *testing.T) {
func TestInterpolationFuncReplace(t *testing.T) {
testCases := []functionTestCase{
{
description: "Replace N occurences",
description: "Replace N occurrences",
text: `${replace("foo bar bar", " bar", "", -1)}`,
expectation: "foo",
},
{
description: "Replace 0 occurences",
description: "Replace 0 occurrences",
text: `${replace("foo bar bar", " bar", "", 0)}`,
expectation: "foo bar bar",
},
{
description: "Replace 1 occurences",
description: "Replace 1 occurrences",
text: `${replace("foo bar bar", " bar", "", 1)}`,
expectation: "foo bar",
},
Expand Down

0 comments on commit 662f9e4

Please sign in to comment.