travis parallel refactor
parent
9b99de5806
commit
e2f91f0933
|
@ -10,7 +10,7 @@ matrix:
|
||||||
include:
|
include:
|
||||||
- language: python
|
- language: python
|
||||||
env:
|
env:
|
||||||
- TESTSUITE_BOILERPLATE=true
|
- TESTSUITE=boilerplate
|
||||||
before_install:
|
before_install:
|
||||||
- pip install flake8 && flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
- pip install flake8 && flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||||
script: make test
|
script: make test
|
||||||
|
@ -18,7 +18,7 @@ matrix:
|
||||||
- language: go
|
- language: go
|
||||||
go: 1.12.9
|
go: 1.12.9
|
||||||
env:
|
env:
|
||||||
- TESTSUITE_LINT=true
|
- TESTSUITE=lint
|
||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get install -y libvirt-dev
|
- sudo apt-get install -y libvirt-dev
|
||||||
script: make test
|
script: make test
|
||||||
|
@ -26,7 +26,7 @@ matrix:
|
||||||
- language: go
|
- language: go
|
||||||
go: 1.12.9
|
go: 1.12.9
|
||||||
env:
|
env:
|
||||||
- TESTSUITE_UNIT=true
|
- TESTSUITE=unittest
|
||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get install -y libvirt-dev
|
- sudo apt-get install -y libvirt-dev
|
||||||
script: make test
|
script: make test
|
||||||
|
|
30
test.sh
30
test.sh
|
@ -14,18 +14,12 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
set -e -o pipefail
|
set -eu -o pipefail
|
||||||
# TODO: fix exit code numbers
|
|
||||||
if [[ -z "$TESTSUITE_LINT" && -z "$TESTSUITE_UNIT" && -z "$TESTSUITE_BOILERPLATE" ]]
|
|
||||||
then # if all of them are not set then it is a local run
|
|
||||||
TESTSUITE_LINT=true
|
|
||||||
TESTSUITE_UNIT=true
|
|
||||||
TESTSUITE_BOILETPLATE=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
TESTSUITE="${TESTSUITE:-all}"
|
||||||
exitcode=0
|
exitcode=0
|
||||||
|
|
||||||
if [[ ! -z "$TESTSUITE_LINT" ]]
|
if [ "$TESTSUITE" = "lint" ] || [ "$TESTSUITE" = "all" ]
|
||||||
then
|
then
|
||||||
echo "= make lint ============================================================="
|
echo "= make lint ============================================================="
|
||||||
make -s lint-ci && echo ok || ((exitcode += 4))
|
make -s lint-ci && echo ok || ((exitcode += 4))
|
||||||
|
@ -35,15 +29,9 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ ! -z "$TESTSUITE_LINT" ]]
|
|
||||||
then
|
|
||||||
echo "= make lint ============================================================="
|
|
||||||
make -s lint-ci && echo ok || ((exitcode += 4))
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
if [ "$TESTSUITE" = "boilerplate" ] || [ "$TESTSUITE" = "all" ]
|
||||||
if [[ ! -z "$TESTSUITE_BOILERPLATE" ]]
|
then
|
||||||
then
|
|
||||||
echo "= boilerplate ==========================================================="
|
echo "= boilerplate ==========================================================="
|
||||||
readonly PYTHON=$(type -P python || echo docker run --rm -it -v $(pwd):/minikube -w /minikube python python)
|
readonly PYTHON=$(type -P python || echo docker run --rm -it -v $(pwd):/minikube -w /minikube python python)
|
||||||
readonly BDIR="./hack/boilerplate"
|
readonly BDIR="./hack/boilerplate"
|
||||||
|
@ -51,17 +39,17 @@ then
|
||||||
if [[ -n "${missing}" ]]; then
|
if [[ -n "${missing}" ]]; then
|
||||||
echo "boilerplate missing: $missing"
|
echo "boilerplate missing: $missing"
|
||||||
echo "consider running: ${BDIR}/fix.sh"
|
echo "consider running: ${BDIR}/fix.sh"
|
||||||
((exitcode += 4))
|
((exitcode += 8))
|
||||||
else
|
else
|
||||||
echo "ok"
|
echo "ok"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ ! -z "$TESTSUITE_UNIT" ]]
|
if [ "$TESTSUITE" = "unittest" ] || [ "$TESTSUITE" = "all" ]
|
||||||
then
|
then
|
||||||
echo "= schema_check =========================================================="
|
echo "= schema_check =========================================================="
|
||||||
go run deploy/minikube/schema_check.go >/dev/null && echo ok || ((exitcode += 8))
|
go run deploy/minikube/schema_check.go >/dev/null && echo ok || ((exitcode += 16))
|
||||||
|
|
||||||
echo "= go test ==============================================================="
|
echo "= go test ==============================================================="
|
||||||
cov_tmp="$(mktemp)"
|
cov_tmp="$(mktemp)"
|
||||||
|
@ -72,7 +60,7 @@ then
|
||||||
-tags "container_image_ostree_stub containers_image_openpgp" \
|
-tags "container_image_ostree_stub containers_image_openpgp" \
|
||||||
-covermode=count \
|
-covermode=count \
|
||||||
-coverprofile="${cov_tmp}" \
|
-coverprofile="${cov_tmp}" \
|
||||||
${pkgs} && echo ok || ((exitcode += 16))
|
${pkgs} && echo ok || ((exitcode += 32))
|
||||||
tail -n +2 "${cov_tmp}" >>"${COVERAGE_PATH}"
|
tail -n +2 "${cov_tmp}" >>"${COVERAGE_PATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue