diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac8c3d762311..2d3a8824e342 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,10 @@ jobs: max_attempts: 5 command: npm ci - - run: npm run test + - name: Jest Unit Tests + run: npm run test env: CI: true + + - name: Pull Request Tests + run: tests/unit/getPullRequestsMergedBetweenTest.sh diff --git a/tests/unit/getPullRequestsMergedBetweenTest.sh b/tests/unit/getPullRequestsMergedBetweenTest.sh index f5c0a660a315..e1c550376d12 100755 --- a/tests/unit/getPullRequestsMergedBetweenTest.sh +++ b/tests/unit/getPullRequestsMergedBetweenTest.sh @@ -1,5 +1,8 @@ #!/bin/bash +# Fail immediately if there is an error thrown +set -e + TEST_DIR=$(dirname "$(dirname "$(cd "$(dirname "$0")" || exit 1;pwd)/$(basename "$0")")") DUMMY_DIR="$HOME/DumDumRepo" getPullRequestsMergedBetween="$TEST_DIR/utils/getPullRequestsMergedBetween.js" @@ -53,6 +56,8 @@ fi info "Initializing Git repo..." git init -b main +git config user.email "test@test.com" +git config user.name "test" git add package.json package-lock.json git commit -m "Initial commit" @@ -226,8 +231,8 @@ success "Bumped version to 1.1.1 on main!" info "Cherry picking PR #7 and the version bump to staging..." git checkout staging git checkout -b cherry-pick-staging-7 -git cherry-pick -S -x --mainline 1 --strategy=recursive -Xtheirs "$PR_7_MERGE_COMMIT" -git cherry-pick -S -x --mainline 1 "$VERSION_BUMP_MERGE_COMMIT" +git cherry-pick -x --mainline 1 --strategy=recursive -Xtheirs "$PR_7_MERGE_COMMIT" +git cherry-pick -x --mainline 1 "$VERSION_BUMP_MERGE_COMMIT" git checkout staging git merge cherry-pick-staging-7 --no-ff -m "Merge pull request #9 from Expensify/cherry-pick-staging-7" git branch -d cherry-pick-staging-7