Skip to content

Commit

Permalink
Fix permissions problem on CI (maybe)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvps committed Apr 11, 2024
1 parent ea08637 commit dbe5f51
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
run-tests:
strategy:
matrix:
python: [ '3.9', '3.12', '>3.12' ]
python: [ '3.9', '3.12', 'latest' ]

services:
dirsrv:
Expand All @@ -27,13 +27,20 @@ jobs:
--health-cmd "dsctl localhost healthcheck --check backends:localhost:search" --health-interval 10s --health-timeout 5s --health-retries 5
runs-on: ubuntu-latest
container:
image: ${{ matrix.python }}
env:
LDAP_BIND_SERVER: ${{env.LDAP_BIND_SERVER}}
LDAP_BIND_DN: ${{env.LDAP_BIND_DN}}
LDAP_BIND_PASSWORD: ${{env.LDAP_BIND_PASSWORD}}
TEST_SUFFIX: ${{env.TEST_SUFFIX}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python }}
- name: Install package dependencies
run: |
sudo apt-get install -y libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev
Expand Down
7 changes: 7 additions & 0 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ def reset_database():
else:
print(f"LDAP invalid credentials, attempt {str(tries)} failed")
time.sleep(1)
except ldap.SERVER_DOWN as e:
tries += 1
if tries > 30:
raise e
else:
print(f"LDAP server down, attempt {str(tries)} failed")
time.sleep(1)

with LdapConnection() as conn:
things = (
Expand Down

0 comments on commit dbe5f51

Please sign in to comment.