Merge pull request #880 from joshwget/add-unit-tests-to-ci

Add unit tests to CI
This commit is contained in:
Darren Shepherd
2016-04-13 11:53:19 -07:00
3 changed files with 10 additions and 1 deletions

View File

@@ -71,6 +71,7 @@ minimal: initrd dist/artifacts/vmlinuz
iso: dist/artifacts/rancheros.iso dist/artifacts/iso-checksums.txt
test: minimal
./scripts/unit-test
cd tests/integration && HOST_ARCH=$(HOST_ARCH) ARCH=$(ARCH) tox
.PHONY: all minimal initrd iso installer test

View File

@@ -161,7 +161,7 @@ func TestParseCmdline(t *testing.T) {
"rescue": true,
"key1": "value1",
"key2": "value2",
"keyArray": []string{"1", "2"},
"keyArray": []interface{}{"1", "2"},
"obj1": map[interface{}]interface{}{
"key3": "3value",
"obj2": map[interface{}]interface{}{

8
scripts/unit-test Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -e
cd $(dirname $0)/..
PACKAGES="$(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor)' | sed -e 's!^!./!' -e 's!$!/...!')"
go test -race -cover -tags=test $PACKAGES