Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
16d007f
Update Python versions and use matrix to avoid repetition
Feb 7, 2025
564ccab
Merge pull request #3 from cybertec-postgresql/fix-test-runners
avandras Feb 10, 2025
236e1c3
Remove bogus section from workflow def
Feb 10, 2025
93f9f0b
Attempt fixing coverage part
Feb 12, 2025
bd69436
Update ydiff version requirements
Feb 12, 2025
f1dea6b
Update ydiff/cdiff import based on the main fork
Feb 12, 2025
9766001
Include setuptools in requirements, as it's no longer included autoam…
Feb 12, 2025
2dac971
Update install_deps.py
Feb 12, 2025
b6d929f
Fix mock import
Feb 12, 2025
6bdaccb
Fix mock import even more
Feb 12, 2025
5db18c4
Fix mock import even moarer
Feb 12, 2025
729dec3
Fix mock import even mooooarer
Feb 12, 2025
378d0a1
Fix behave tests + remove Python 3.7 for MacOS
Feb 12, 2025
4c33c38
Revert to Ubuntu 22.04 in behave tests for now
Feb 12, 2025
e442a7e
Fix behave test preps
Feb 12, 2025
0bbbe45
Test behave with ubuntu-latest
Feb 13, 2025
0497c73
Skip Python 3.12 for 3.13
Feb 13, 2025
5d004bd
Remove Python 3.13 for now, use older Ubuntu for behave
Feb 18, 2025
784b739
Update pyright action versions
Feb 18, 2025
35a5be7
Remove non-existent matrix ref
Feb 18, 2025
fc297d4
Revert to Python 3.11 for coverage for now
Feb 18, 2025
fa126c8
Ignore private import
Feb 18, 2025
55a1c14
Don't use shpinx-rtd-theme 3.0 yet
Feb 18, 2025
f826bf1
Fix docs depracation warning
Feb 18, 2025
7359084
Install deps for coverage
Feb 19, 2025
7e05401
Up- and then download test output for later use
Feb 21, 2025
c4726b3
Fix up/down copypasta
Feb 21, 2025
546228e
Use RUNNER_TEMP as temp dir
Feb 24, 2025
08a35ed
Debug temp location #1
Feb 24, 2025
b3d576b
Fix wrong path
Feb 24, 2025
7ce5df2
Limit sphinx version
Feb 24, 2025
0003853
Debug temp location #2
Feb 24, 2025
0491c41
Debug temp location #3
Feb 24, 2025
e33d517
Debug temp location #4
Feb 24, 2025
b2c4199
Debug temp location #5
Feb 24, 2025
18b9437
Debug temp location 6
Feb 24, 2025
69e8a91
Debug temp location 7
Feb 24, 2025
c3636dc
Fix up- and download
Feb 24, 2025
1463f48
Debug upload again... 1
Feb 24, 2025
c2443e3
Fix upload again... 1
Feb 24, 2025
05ade9b
Coveralls should come only after post-unit
Feb 24, 2025
21240ec
Remove some behave tests temporarily
Mar 7, 2025
587491e
Merge pull request #4 from cybertec-postgresql/fix-workflow
avandras Mar 10, 2025
9983b12
Implement multisite-switchover CTL command
Mar 26, 2025
b52df14
Merge test fixes from master
Mar 26, 2025
925a046
Remove test file accidentally added in the merge
Mar 26, 2025
39fc081
Add missing imports in tests
Mar 26, 2025
783c3a1
Fix more imports, remove stale file
Mar 26, 2025
6e9c634
Fix more
Mar 26, 2025
c1a27a2
Fix even more
Mar 26, 2025
2335fe5
Solve a small logic issue
Mar 27, 2025
ada37ba
Set candidate name reliably if there is only one
Mar 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/install_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ def main():


if __name__ == '__main__':
sys.exit(main())
sys.exit(main())
6 changes: 3 additions & 3 deletions .github/workflows/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
import shutil
import subprocess
import sys
import tempfile


def main():
what = os.environ.get('DCS', sys.argv[1] if len(sys.argv) > 1 else 'all')
tmp = os.environ.get('RUNNER_TEMP')

if what == 'all':
flake8 = subprocess.call([sys.executable, 'setup.py', 'flake8'])
test = subprocess.call([sys.executable, 'setup.py', 'test'])
version = '.'.join(map(str, sys.version_info[:2]))
shutil.move('.coverage', os.path.join(tempfile.gettempdir(), '.coverage.' + version))
print(shutil.move('.coverage', '.coverage.' + version))
print(os.getcwd())
return flake8 | test
elif what == 'combine':
tmp = tempfile.gettempdir()
for name in os.listdir(tmp):
if name.startswith('.coverage.'):
shutil.move(os.path.join(tmp, name), name)
Expand Down
109 changes: 51 additions & 58 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,72 +13,64 @@ env:

jobs:
unit:
runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
exclude:
- os: macos-latest
python-version: 3.7
- os: ubuntu-latest
python-version: 3.7
include:
- os: ubuntu-22.04
python-version: 3.7

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: 3.7
if: matrix.os != 'macos'
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python .github/workflows/install_deps.py
if: matrix.os != 'macos'
- name: Run tests and flake8
run: python .github/workflows/run_tests.py
if: matrix.os != 'macos'

- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: python .github/workflows/install_deps.py
- name: Run tests and flake8
run: python .github/workflows/run_tests.py

- name: Set up Python 3.9
uses: actions/setup-python@v5
- name: Upload logs from unit tests
uses: actions/upload-artifact@v4
with:
python-version: 3.9
- name: Install dependencies
run: python .github/workflows/install_deps.py
- name: Run tests and flake8
run: python .github/workflows/run_tests.py
name: logs-${{ matrix.os }}-${{ matrix.python-version }}
path: ${{ github.workspace }}/.coverage.*
include-hidden-files: true
retention-days: 1

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: python .github/workflows/install_deps.py
- name: Run tests and flake8
run: python .github/workflows/run_tests.py
post-unit-coverage:
runs-on: ${{ matrix.os }}
needs: unit
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: python .github/workflows/install_deps.py
- name: Run tests and flake8
run: python .github/workflows/run_tests.py

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: python .github/workflows/install_deps.py
- name: Run tests and flake8
run: python .github/workflows/run_tests.py

- name: Download logs from unit tests
uses: actions/download-artifact@v4
with:
pattern: logs-${{ matrix.os }}-*
merge-multiple: true
- name: Combine coverage
run: python .github/workflows/run_tests.py combine

Expand All @@ -93,27 +85,28 @@ jobs:
run: python -m coveralls --service=github

behave:
runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }}
env:
DCS: ${{ matrix.dcs }}
ETCDVERSION: 3.4.23
PGVERSION: 16.1-1 # for windows and macos
strategy:
fail-fast: false
matrix:
os: [ubuntu]
python-version: [3.7, 3.12]
os: [ubuntu-22.04]
python-version: [3.13]
# python-version: [3.7, 3.13]
dcs: [etcd, etcd3, consul, exhibitor, kubernetes, raft]
include:
- os: macos
python-version: 3.8
dcs: raft
- os: macos
python-version: 3.9
dcs: etcd
- os: macos
python-version: 3.11
dcs: etcd3
# include:
# - os: macos-latest
# python-version: 3.8
# dcs: raft
# - os: macos-latest
# python-version: 3.9
# dcs: etcd
# - os: macos-latest
# python-version: 3.11
# dcs: etcd3

steps:
- uses: actions/checkout@v4
Expand All @@ -131,7 +124,7 @@ jobs:
sudo sh -c 'wget -qO - https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg'
sudo sh -c 'echo "deb [signed-by=/etc/apt/trusted.gpg.d/citusdata_community.gpg] https://packagecloud.io/citusdata/community/ubuntu/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/citusdata_community.list'
sudo sh -c 'wget -qO - https://packagecloud.io/citusdata/community/gpgkey | gpg --dearmor > /etc/apt/trusted.gpg.d/citusdata_community.gpg'
if: matrix.os == 'ubuntu'
if: startsWith(matrix.os, 'ubuntu')
- name: Install dependencies
run: python .github/workflows/install_deps.py
- name: Run behave tests
Expand All @@ -154,7 +147,7 @@ jobs:

coveralls-finish:
name: Finalize coveralls.io
needs: unit
needs: post-unit-coverage
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
Expand All @@ -176,7 +169,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.12
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.12
Expand Down
Loading
Loading