Skip to content

Commit 4f5955d

Browse files
committed
split rsc/non rsc tests on gha
1 parent 1be7b5b commit 4f5955d

4 files changed

Lines changed: 41 additions & 6 deletions

File tree

.github/workflows/tests.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,33 @@ jobs:
3535
python -m pip install -e .[dev,torch]
3636
- name: Run Tests
3737
run: |
38-
pytest --cov --cov-report xml .
38+
pytest -m 'not rsc_test' --cov --cov-report xml .
3939
- name: Upload coverage
4040
uses: codecov/codecov-action@v2
41+
42+
test-rsconnect:
43+
name: "Test RSConnect"
44+
runs-on: ubuntu-latest
45+
if: ${{ !github.event.pull_request.head.repo.fork }}
46+
steps:
47+
- uses: actions/checkout@v2
48+
- uses: actions/setup-python@v2
49+
with:
50+
python-version: 3.8
51+
- name: Install dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
python -m pip install -r requirements/dev.txt
55+
python -m pip install -e .[test]
56+
- name: run RStudio Connect
57+
run: |
58+
docker-compose up --build -d
59+
make dev
60+
env:
61+
RSC_LICENSE: ${{ secrets.RSC_LICENSE }}
62+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
63+
64+
# NOTE: edited to run checks for python package
65+
- name: Run tests
66+
run: |
67+
pytest vetiver -m 'rsc_test'

Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ help:
2626
@echo "release - package and upload a release"
2727
@echo "dist - package"
2828
@echo "install - install the package to the active Python's site-packages"
29-
@echo "develop - install the package in development mode"
29+
@echo "dev - generate RStudio Connect API keys"
30+
@echo "dev-start - start up development RStudio Connect in Docker"
31+
@echo "dev-stop - stop RStudio Connect dev container"
3032

3133
clean: clean-build clean-pyc clean-test docs-clean
3234

@@ -95,7 +97,3 @@ dev-stop:
9597

9698
$(RSC_API_KEYS): dev-start
9799
python script/setup-rsconnect/dump_api_keys.py $@
98-
99-
test:
100-
pytest
101-

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
[build-system]
22
requires = ["setuptools>=45", "wheel"]
33
build-backend = "setuptools.build_meta"
4+
5+
[tool.pytest.ini_options]
6+
testpaths = ["pins"]
7+
addopts = "--doctest-modules"
8+
doctest_optionflags = "NORMALIZE_WHITESPACE"
9+
markers = [
10+
"rsc_test: tests for rstudio connect",
11+
]

vetiver/tests/test_rsconnect.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
RSC_SERVER_URL = "http://localhost:3939"
77
RSC_KEYS_FNAME = "vetiver/tests/rsconnect_api_keys.json"
88

9+
pytestmark = pytest.mark.rsc_test # noqa
10+
911
def rsc_from_key(name):
1012
from pins.rsconnect.api import RsConnectApi
1113

0 commit comments

Comments
 (0)