Skip to content

Commit 7e5e2e8

Browse files
ci: re-enable integration tests with mysql-*operator (#1013)
* Only try to edit `requirements.txt` if it exists * If `requirements.txt` does not exist, then assume that the requirement is in `pyproject.toml` and edit that instead * Enable the integration tests with `mysql-operator` and `mysql-k8s-operator` again * Remove the `static-charm` tox runs from the DB workflow, as none of the DB operators have one defined * Pin `tox` to anything compatible with 4.2 Fixes #987.
1 parent b2c4a3e commit 7e5e2e8

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

.github/workflows/db-charm-tests.yaml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,35 @@ jobs:
1111
charm-repo:
1212
- "canonical/postgresql-operator"
1313
- "canonical/postgresql-k8s-operator"
14-
# TODO: uncomment once we've fixed https://github.com/canonical/operator/issues/987
15-
# - "canonical/mysql-operator"
16-
# - "canonical/mysql-k8s-operator"
14+
- "canonical/mysql-operator"
15+
- "canonical/mysql-k8s-operator"
1716

1817
steps:
1918
- name: Checkout the ${{ matrix.charm-repo }} repository
2019
uses: actions/checkout@v3
2120
with:
2221
repository: ${{ matrix.charm-repo }}
2322

23+
- name: Checkout the operator repository
24+
uses: actions/checkout@v3
25+
with:
26+
path: myops
27+
28+
- name: Install patch dependencies
29+
run: pip install poetry~=1.6
30+
2431
- name: Update 'ops' dependency in test charm to latest
2532
run: |
26-
sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt
27-
echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" >> requirements.txt
33+
if [ -e "requirements.txt" ]; then
34+
sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt
35+
echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" >> requirements.txt
36+
else
37+
sed -i -e "s/^ops[ ><=].*/ops = {path = \"myops\"}/" pyproject.toml
38+
poetry lock
39+
fi
2840
2941
- name: Install dependencies
30-
run: pip install tox==4.2.8
42+
run: pip install tox~=4.2
3143

3244
- name: Run the charm's unit tests
3345
run: tox -vve unit
34-
35-
- name: Run the charm's static analysis checks
36-
run: tox -vve static-charm

.github/workflows/framework-tests.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
uses: actions/setup-python@v2
1313

1414
- name: Install tox
15-
run: pip install tox
15+
run: pip install tox~=4.2
1616

1717
- name: Run linting
1818
run: tox -e lint
@@ -26,7 +26,7 @@ jobs:
2626
uses: actions/setup-python@v2
2727

2828
- name: Install tox
29-
run: pip install tox
29+
run: pip install tox~=4.2
3030

3131
- name: Run static type checks
3232
run: tox -e static
@@ -47,7 +47,7 @@ jobs:
4747
python-version: ${{ matrix.python-version }}
4848

4949
- name: Install tox
50-
run: pip install tox
50+
run: pip install tox~=4.2
5151

5252
- name: Run unit tests
5353
run: tox -e unit
@@ -73,7 +73,7 @@ jobs:
7373
go-version: "1.20"
7474

7575
- name: Install tox
76-
run: pip install tox
76+
run: pip install tox~=4.2
7777

7878
- name: Install Pebble
7979
run: go install github.com/canonical/pebble/cmd/pebble@latest
@@ -88,7 +88,7 @@ jobs:
8888
- name: Run Real pebble tests
8989
run: tox -e unit -- -k RealPebble
9090
env:
91-
RUN_REAL_PEBBLE_TESTS: 1
91+
RUN_REAL_PEBBLE_TESTS: 1
9292
PEBBLE: /tmp/pebble
9393

9494
pip-install:
@@ -106,3 +106,4 @@ jobs:
106106
- name: Test 'pip install'
107107
# Shouldn't happen, but pip install will fail if ls returns multiple lines
108108
run: pip install $(ls dist/ops*.gz)
109+

.github/workflows/observability-charm-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" >> requirements.txt
2727
2828
- name: Install dependencies
29-
run: pip install tox
29+
run: pip install tox~=4.2
3030

3131
- name: Run the charm's unit tests
3232
run: tox -vve unit

0 commit comments

Comments
 (0)