Skip to content

Commit fd0620e

Browse files
committed
docker for testing added
1 parent acf8da0 commit fd0620e

File tree

6 files changed

+110
-41
lines changed

6 files changed

+110
-41
lines changed

.bumpversion.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ parse = (?P<major>\d+)
88
((?P<release>[a-z]+)
99
?(\.)?
1010
(?P<build>\d+))?
11-
serialize =
11+
serialize =
1212
{major}.{minor}.{patch}{release}{build}
1313
{major}.{minor}.{patch}
1414

1515
[bumpversion:part:release]
1616
first_value = a
17-
values =
17+
values =
1818
a
1919
b
2020
rc

.dockerignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.pytest_cache/
2+
dist/
3+
env/
4+
logs/
5+
.bumpversion.cfg
6+
.env
7+
.flake8
8+
.git/
9+
.github/
10+
.mypy_cache/
11+
.vscode/
12+
build/
13+
dbt_iris.egg-info/

.github/workflows/main.yml

+6-39
Original file line numberDiff line numberDiff line change
@@ -105,46 +105,13 @@ jobs:
105105
path: dist/
106106

107107
test-build:
108-
name: verify packages / python ${{ matrix.python-version }} / ${{ matrix.os }}
109-
110108
needs: build
111109

112-
runs-on: ${{ matrix.os }}
113-
114-
strategy:
115-
fail-fast: false
116-
matrix:
117-
os: [ubuntu-latest, macos-latest, windows-latest]
118-
python-version: [3.8, 3.9, '3.10']
110+
runs-on: ubuntu-latest
119111

120112
steps:
121-
- name: Set up Python ${{ matrix.python-version }}
122-
uses: actions/setup-python@v4
123-
with:
124-
python-version: ${{ matrix.python-version }}
125-
126-
- name: Install python dependencies
127-
run: |
128-
pip install --user --upgrade pip
129-
pip install --upgrade wheel
130-
pip --version
131-
- uses: actions/download-artifact@v3
132-
with:
133-
name: dist
134-
path: dist/
135-
136-
- name: Show distributions
137-
run: ls -lh dist/
138-
139-
- name: Install wheel distributions
140-
run: |
141-
find ./dist/*.whl -maxdepth 1 -type f | xargs pip install --force-reinstall --find-links=dist/
142-
- name: Check wheel distributions
143-
run: |
144-
dbt --version
145-
- name: Install source distributions
146-
run: |
147-
find ./dist/*.gz -maxdepth 1 -type f | xargs pip install --force-reinstall --find-links=dist/
148-
- name: Check source distributions
149-
run: |
150-
dbt --version
113+
- uses: actions/checkout@v3
114+
- name: Build Docker image
115+
run: docker build -t dbt-iris:$GITHUB_SHA .
116+
- name: Run Tests
117+
run: docker run --rm dbt-iris:$GITHUB_SHA run_tests_in_docker.sh

Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM intersystemsdc/iris-community
2+
3+
USER root
4+
5+
RUN apt-get update && apt-get -y install git
6+
7+
USER ${ISC_PACKAGE_MGRUSER}
8+
9+
COPY --chown=${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_MGRGROUP} . /home/irisowner/dbt-iris
10+
11+
WORKDIR /home/irisowner/dbt-iris
12+
13+
ENV PATH="$PATH:/home/irisowner/.local/bin/"
14+
ENV PYTHONPATH="/home/irisowner/dbt-iris"
15+
16+
RUN python3 -m pip install --upgrade pip \
17+
&& pip install -r requirements-dev.txt -r requirements.txt
18+
19+
ENTRYPOINT [ "bash" ]

docker-compose.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3'
2+
services:
3+
iris:
4+
image: intersystemsdc/iris-community
5+
command:
6+
- -a
7+
- iris session iris -U %SYS '##class(Security.Users).UnExpireUserPasswords("*")'
8+
- --check-caps false
9+
ports:
10+
- 1972:1972
11+
- 52773:52773

run_tests_in_docker.sh

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
iris_start () {
4+
iris start iris
5+
6+
iris session iris -U %SYS '##class(Security.Users).UnExpireUserPasswords("*")'
7+
}
8+
9+
iris_stop () {
10+
iris stop iris quietly
11+
}
12+
13+
iris_start
14+
15+
pytest
16+
17+
exit=$?
18+
19+
if [ $exit -ne 0 ]; then
20+
iris_stop
21+
exit $exit
22+
fi
23+
24+
cd $HOME
25+
26+
git clone --depth 1 https://github.com/dbt-labs/jaffle_shop.git
27+
28+
cd jaffle_shop
29+
30+
git pull
31+
32+
mkdir -p $HOME/.dbt
33+
34+
cat > $HOME/.dbt/profiles.yml <<EOF
35+
36+
jaffle_shop:
37+
38+
target: dev
39+
outputs:
40+
dev:
41+
type: iris
42+
host: localhost
43+
port: 1972
44+
user: _SYSTEM
45+
pass: SYS
46+
namespace: USER
47+
schema: dbt
48+
49+
EOF
50+
51+
dbt seed
52+
dbt run
53+
dbt test
54+
dbt docs generate
55+
56+
exit=$?
57+
58+
iris_stop
59+
exit $exit

0 commit comments

Comments
 (0)