From a6a7aca8af10745c3bc975bdf85c8906179c6c1b Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Fri, 31 Jul 2020 10:32:31 +0200 Subject: [PATCH] travis: add itest on Windows This commit adds an integration test that runs on a Windows virtual machine on Travis. The tests run inside of a "Git Bash" environment which supports the same command line syntax as a proper bash but doesn't have all the tooling installed. Some tools also behave differently on Windows. Therefore we also have to simplify the command to upload the logs to termbin and remove the upload to file.io on Windows because both the find and tar command don't work as expected. --- .travis.yml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d9e7064a..d5d9204a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,7 +68,32 @@ jobs: - GOARM=7 GOARCH=arm GOOS=linux CGO_ENABLED=0 make itest-only arch: arm64 + - name: Btcd Integration Windows + script: + - make itest-windows + os: windows + before_install: + - choco upgrade --no-progress -y make netcat curl findutils + - export MAKE=mingw32-make + after_script: + - |- + case $TRAVIS_OS_NAME in + windows) + echo "Uploading to termbin.com..." + for f in ./lntest/itest/*.log; do cat $f | nc termbin.com 9999 | xargs -r0 printf "$f"' uploaded to %s'; done + ;; + esac + after_script: - - LOG_FILES=./lntest/itest/*.log - - echo "Uploading to termbin.com..." && find $LOG_FILES | xargs -I{} sh -c "cat {} | nc termbin.com 9999 | xargs -r0 printf '{} uploaded to %s'" - - echo "Uploading to file.io..." && tar -zcvO $LOG_FILES | curl -s -F 'file=@-;filename=logs.tar.gz' https://file.io | xargs -r0 printf 'logs.tar.gz uploaded to %s\n' + - |- + case $TRAVIS_OS_NAME in + windows) + # Needs other commands, see after_script of the Windows build + ;; + + *) + LOG_FILES=./lntest/itest/*.log + echo "Uploading to termbin.com..." && find $LOG_FILES | xargs -I{} sh -c "cat {} | nc termbin.com 9999 | xargs -r0 printf '{} uploaded to %s'" + echo "Uploading to file.io..." && tar -zcvO $LOG_FILES | curl -s -F 'file=@-;filename=logs.tar.gz' https://file.io | xargs -r0 printf 'logs.tar.gz uploaded to %s\n' + ;; + esac