Skip to content

Commit aa59865

Browse files
author
Juan Tirado
committed
Extend github actions.
1 parent 901e92d commit aa59865

4 files changed

Lines changed: 65 additions & 47 deletions

File tree

.github/workflows/test.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Integration test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
integration:
7+
name: Integration
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python:
12+
- "3.8"
13+
- "3.9"
14+
- "3.10"
15+
steps:
16+
- name: Check out code
17+
uses: actions/checkout@v3
18+
- name: Prepare environment
19+
with:
20+
juju-channel: "3.0/stable"
21+
run: |
22+
sudo mkdir -p ~/.config
23+
sudo chown -R $USER:$USER ~/.config
24+
sudo chmod -R 755 ~/.config
25+
sudo ls -l -R ~/.config
26+
attempts=0
27+
while [ $attempts -lt 3 ]; do
28+
sudo snap install lxd && break || true
29+
attempts=$((attempts + 1))
30+
done
31+
32+
lxd waitready --timeout 120
33+
sudo chmod 666 /var/snap/lxd/common/lxd/unix.socket
34+
lxd init --auto --network-address='[::]' --network-port=8443
35+
lxc network set lxdbr0 ipv6.address none
36+
37+
lxc storage create juju-zfs dir source=/var/snap/lxd/common/lxd/storage-pools/juju-zfs
38+
lxc storage create juju-btrfs dir source=/var/snap/lxd/common/lxd/storage-pools/juju-btrfs
39+
40+
# TODO (stickupkid): we should be able to use security.priviledged="true",
41+
# but for some reason that doesn't work in 2 nested deep containers. So
42+
# instead we turn apparmor off, we should investigate why this doesn't work correctly.
43+
# lxc profile set default raw.lxc lxc.apparmor.profile=unconfined
44+
45+
attempts=0
46+
while [ $attempts -lt 3 ]; do
47+
sudo snap install juju --channel "${JUJU_CHANNEL}" && break || true
48+
attempts=$((attempts + 1))
49+
done
50+
51+
juju bootstrap localhost test \
52+
--config 'identity-url=https://api.staging.jujucharms.com/identity' \
53+
--config 'allow-model-access=true' \
54+
--config 'test-mode=true'
55+
- name: Setup Python
56+
uses: actions/setup-python@v2
57+
with:
58+
python-version: ${{ matrix.python }}
59+
- name: Install dependencies
60+
run: pip install tox
61+
- name: Run unit tests
62+
run: tox -e py3
63+
- name: Run integration
64+
run: tox -e py3 -e integration,serial

.github/workflows/tox.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

juju/jasyncio.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
get_event_loop_policy, CancelledError # noqa
3535

3636

37-
3837
try:
3938
from asyncio import get_running_loop
4039
except ImportError:

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ commands =
5555
envdir = {toxworkdir}/py3
5656
commands =
5757
# These need to be installed in a specific order
58-
pip install urllib3==1.25.7
58+
pip install urllib3==1.26.0
5959
pip install pylxd
6060
python -m pytest --tb native -ra -v -n auto {toxinidir}/tests/unit {posargs}
6161

@@ -64,7 +64,6 @@ commands =
6464
envdir = {toxworkdir}/py3
6565
commands =
6666
# These need to be installed in a specific order
67-
#pip install urllib3==1.25.7
6867
pip install urllib3==1.26.0
6968
pip install pylxd
7069
python -m pytest --tb native -ra -v -s {posargs:-m 'serial'}

0 commit comments

Comments
 (0)