This was easily solved with effectively no changes by switching to GitHub for CI. It seems to be an issue with Travis at it’s core, but I have no interest in Ruby and so am not about to try to dig into the cause of this.
I tried tracing both by running as
bash -x and with
set -x ... set +x wrapping the problematic code, with and without PS4 set for better tracing. Also tried with
set -euo pipefail to see if that would force it to stop with an error. I even went so far as to run part of the problematic code from the tests directly in
.travis.yml. Nothing helped, lol.
Part of the effect of this was that it ignored/mis-reported coverage for parts that had to have been run. For example the install script was running twice to test installing from the local repo (for development) and from GitHub Releases. Coverage reports said it was run only once though despite the fact it worked fine locally, and even after I customized the test for Travis.
On the other hand, GitHub CI not only ran the code, but all those tests Travis had to have ignored as it couldn’t run them “just work”, AND I don’t need any custom tests for CI there.
I’ve been using Travis as a CI for many of my projects for almost 4 years now. Countless hours have gone to attempting to get it working properly rather than development of my projects. After the above problem and an issue last night trying to setup CI/CD for kcov and finding I have to install at least Ruby + travis-cli to do so, I’m all done. It was fine while it was all I could use, but I’d prefer to concentrate on my projects rather than finding workarounds for problems with someone else’s.