From e31bfbfcd060e5734915c09c5f664011ab20d692 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Jun 07 2019 15:06:41 +0000 Subject: [PATCH 1/2] WIP Signed-off-by: Stephen Gallagher --- diff --git a/.cico.pipeline b/.cico.pipeline index 159a818..b6719a2 100644 --- a/.cico.pipeline +++ b/.cico.pipeline @@ -2,6 +2,7 @@ pipeline { parameters { string(defaultValue: "", description: "", name: "REPO") string(defaultValue: "", description: "", name: "BRANCH") + string(defaultValue: "", description: "", name: "BRANCH_TO") } agent { node { label 'fedora29' } } diff --git a/run_tests.sh b/run_tests.sh index 0c323d9..7f605a5 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -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 @@ if [ -n "$REPO" -a -n "$BRANCH" ]; then 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 diff --git a/tests/pr_tests.sh b/tests/pr_tests.sh index 027ca83..469ee60 100755 --- a/tests/pr_tests.sh +++ b/tests/pr_tests.sh @@ -16,7 +16,7 @@ pushd $GIT_ROOT modified_files=$(git log --name-only \ --pretty=oneline \ --full-index \ - $MODULE_DEFAULTS_TEST_BASELINE..HEAD \ + $MODULE_DEFAULTS_TEST_BASELINE..$MODULE_DEFAULTS_TEST_UPDATED \ | grep -vE '^[0-9a-f]{40} ' | sort -u) for file in ${modified_files[@]}; do From f1ca8797c9c1a1f7b51efb99d77897f94c7adfcd Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Jun 07 2019 15:07:37 +0000 Subject: [PATCH 2/2] Bump without modified Signed-off-by: Stephen Gallagher --- diff --git a/libgit2.yaml b/libgit2.yaml index 80e3dcd..9b95a6a 100644 --- a/libgit2.yaml +++ b/libgit2.yaml @@ -2,7 +2,7 @@ document: modulemd-defaults version: 1 data: module: libgit2 - stream: 0.27 + stream: 0.28 profiles: 0.26: [] 0.27: []