everypolitician / everypolitician-popolo

Ruby gem for interacting with EveryPolitician data for a legislature
MIT License
7 stars 4 forks source link

WIP: Ensure tests introduced on the topic branch fail on the target (don't mention "refactor") #122

Open mhl opened 7 years ago

chrismytton commented 7 years ago

Part of https://github.com/everypolitician/everypolitician/issues/573

chrismytton commented 7 years ago

Hmm looks like the tests are now correctly passing for this pull request but failing for the non-pull request build.

The error on Travis is:

error: pathspec 'master' did not match any file(s) known to git.

@mhl Any thoughts on why this might be and/or how we can workaround it?

chrismytton commented 7 years ago

Just looked into this and the error is because Travis does git clone --depth=50 --branch=check-tests-fail-on-target, which implies the --single-branch option, which means there is no history for the master branch available 😕

chrismytton commented 7 years ago

Looking at https://travis-ci.org/everypolitician/everypolitician-popolo/builds/201902646 it seems that one of the builds has correctly found the word "refactor" in the pull request title but the other three haven't!

chrismytton commented 7 years ago

This is now passing on Travis, yay! I've changed things around a bit so that we're testing the pull request's branch name for the word "refactor" (case-insensitive) and then skipping the check-fail.sh script if it's there.

Note: The code from this pull request shouldn't be used as-is without first changing the branch name check, which is currently checking for the word "check" in order to make this pull request pass 😆

chrismytton commented 7 years ago

Latest version of this script, which I've updated to be consistent with other EveryPolitician bash script that we run on Travis, is visible in https://github.com/everypolitician/scraped/pull/67.