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.
This commit is contained in:
Oliver Gugger 2020-07-31 10:32:31 +02:00
parent 6115a7b12b
commit a6a7aca8af
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

@ -68,7 +68,32 @@ jobs:
- GOARM=7 GOARCH=arm GOOS=linux CGO_ENABLED=0 make itest-only - GOARM=7 GOARCH=arm GOOS=linux CGO_ENABLED=0 make itest-only
arch: arm64 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: 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'" case $TRAVIS_OS_NAME in
- 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' 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