| |
@@ -1,13 +1,14 @@
|
| |
#!/bin/bash
|
| |
|
| |
set -e
|
| |
+ set -x
|
| |
|
| |
if [ -n "$REPO" -a -n "$BRANCH" ]; then
|
| |
git config user.email "noreply@ci.centos.org"
|
| |
git config user.name "CentOS CI"
|
| |
|
| |
# Save the commit ID of the baseline checkout
|
| |
- MODULE_DEFAULTS_TEST_BASELINE=$(git log -1 --pretty=%H)
|
| |
+ MODULE_DEFAULTS_TEST_BASELINE=$(git log -1 --pretty=%H origin/$BRANCH_TO)
|
| |
export MODULE_DEFAULTS_TEST_BASELINE
|
| |
|
| |
# Merge the PR into the current tree
|
| |
@@ -15,14 +16,22 @@
|
| |
git gc --auto
|
| |
git remote add proposed "$REPO"
|
| |
git fetch proposed
|
| |
- git checkout origin/master
|
| |
- git merge --no-ff "proposed/$BRANCH" -m "Merge PR"
|
| |
+
|
| |
+ MODULE_DEFAULTS_TEST_UPDATED=$(git log -1 --pretty=%H proposed/$BRANCH)
|
| |
+ export MODULE_DEFAULTS_TEST_UPDATED
|
| |
+
|
| |
+ # Test that it merges cleanly
|
| |
+ git branch -D baseline || true
|
| |
+ git checkout -b baseline $MODULE_DEFAULTS_TEST_BASELINE
|
| |
+ git merge --no-ff "$MODULE_DEFAULTS_TEST_UPDATED" -m "Merge PR"
|
| |
|
| |
echo "Running tests for branch $BRANCH of repo $REPO"
|
| |
echo "Last commits:"
|
| |
- git log -2
|
| |
+ git log $MODULE_DEFAULTS_TEST_BASELINE..$MODULE_DEFAULTS_TEST_UPDATED
|
| |
|
| |
- # Run any tests that only apply to PRs
|
| |
+ # Run any tests that only apply to PRs.
|
| |
+ # Always run these from the master branch
|
| |
+ git checkout origin/master
|
| |
tests/pr_tests.sh
|
| |
fi
|
| |
|
| |
Signed-off-by: Stephen Gallagher sgallagh@redhat.com