From 02a4b33b621b5dcde863184c3636167cac47dcbb Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Mon, 8 Apr 2019 23:54:12 +0900 Subject: [PATCH] Run python-build directly from make to avoid job cancellation after 10 min no output on travis-ci.org --- .travis.yml | 3 --- Makefile | 13 +++++++++++-- plugins/python-build/test/build/test.bats | 21 --------------------- 3 files changed, 11 insertions(+), 26 deletions(-) delete mode 100644 plugins/python-build/test/build/test.bats diff --git a/.travis.yml b/.travis.yml index 0f64af6d..eb5e1bca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,9 +36,6 @@ install: git clone --depth 1 https://github.com/bats-core/bats-core.git bats # Default for auto-generated jobs. script: make test-build -after_script: | - cat "$(ls -tr ${TMPDIR:-/tmp}/python-build.*.log | tail -1)" - jobs: include: # Shell-based tests should execute every time. diff --git a/Makefile b/Makefile index 9bf21e30..f7f88956 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,17 @@ test: bats PATH="./bats/bin:$$PATH" test/run cd plugins/python-build && $(PWD)/bats/bin/bats $${CI:+--tap} test -test-build: bats - cd plugins/python-build && $(PWD)/bats/bin/bats $${CI:+--tap} test/build +PYTHON_BUILD_ROOT := $(CURDIR)/plugins/python-build +PYTHON_BUILD_OPTS ?= --verbose +PYTHON_BUILD_VERSION ?= 3.8-dev +PYTHON_BUILD_TEST_PREFIX ?= $(PYTHON_BUILD_ROOT)/test/build/tmp/dist + +test-build: + $(PYTHON_BUILD_ROOT)/bin/python-build $(PYTHON_BUILD_OPTS) $(PYTHON_BUILD_VERSION) $(PYTHON_BUILD_TEST_PREFIX) + [ -e $(PYTHON_BUILD_TEST_PREFIX)/bin/python ] + $(PYTHON_BUILD_TEST_PREFIX)/bin/python -V + [ -e $(PYTHON_BUILD_TEST_PREFIX)/bin/pip ] + $(PYTHON_BUILD_TEST_PREFIX)/bin/pip -V bats: git clone --depth 1 https://github.com/bats-core/bats-core.git bats diff --git a/plugins/python-build/test/build/test.bats b/plugins/python-build/test/build/test.bats deleted file mode 100644 index 37fd1345..00000000 --- a/plugins/python-build/test/build/test.bats +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bats - -load ../test_helper -export PATH="$BATS_TEST_DIRNAME/../../bin:$PATH" - -export PYTHON_BUILD_VERSION="${PYTHON_BUILD_VERSION:-3.8-dev}" - -@test "Python build works" { - run python-build "$PYTHON_BUILD_VERSION" "$BATS_TMPDIR/dist" - assert_success - - [ -e "$BATS_TMPDIR/dist/bin/python" ] - run "$BATS_TMPDIR/dist/bin/python" -V - assert_success - "$BATS_TMPDIR/dist/bin/python" -V >&3 2>&3 - - [ -e "$BATS_TMPDIR/dist/bin/pip" ] - run "$BATS_TMPDIR/dist/bin/pip" -V - assert_success - "$BATS_TMPDIR/dist/bin/pip" -V >&3 2>&3 -}