Skip to content

Commit cd8186c

Browse files
authored
Fix version update test failure on main branch (#214)
* Make sure git tags are present when CI runs on main * Fix latest version and control flow in update script
1 parent be86766 commit cd8186c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/test.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
steps:
2727
- uses: actions/checkout@v3
2828
with:
29+
# fetch-depth ensures all tags are present on the repo so we can run update tests successfully
30+
fetch-depth: 0
2931
submodules: "recursive"
3032
- name: Build
3133
id: build
@@ -49,7 +51,9 @@ jobs:
4951
sudo pip install GitPython &&\
5052
# Start postgres
5153
sudo su postgres -c "PG_VERSION=$PG_VERSION RUN_TESTS=0 ./ci/scripts/run-tests-linux.sh" && \
52-
sudo su -c "PG_VERSION=$PG_VERSION python3 ./scripts/test_updates.py -U postgres"
54+
sudo su -c "PG_VERSION=$PG_VERSION python3 ./scripts/test_updates.py -U postgres" &&\
55+
echo "Done with updates"
56+
5357
env:
5458
PG_VERSION: ${{ matrix.postgres }}
5559
if: ${{ startsWith(matrix.os, 'ubuntu') }}

scripts/test_updates.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@ def incompatible_version(pg_version, version_tag):
6464
to_tag = args.to_tag
6565
if from_tag and to_tag:
6666
update_from_tag(from_tag, to_tag)
67+
exit(0)
6768

6869
if from_tag or to_tag:
6970
print("Must specify both or neither from_tag and to_tag")
7071
exit(1)
7172

7273
# test updates from all tags
7374
from_tags = [update_fname.split("--")[0] for update_fname in os.listdir("sql/updates")]
74-
latest_version = "0.0.5"
75+
latest_version = "main"
7576

7677
pg_version = None if not 'PG_VERSION' in os.environ else os.environ['PG_VERSION']
7778
for from_tag in from_tags:

0 commit comments

Comments
 (0)