File tree Expand file tree Collapse file tree 4 files changed +44
-0
lines changed Expand file tree Collapse file tree 4 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 4545 run : |
4646 pip install tox==3.18.1 tox-gh-actions==1.3.0
4747
48+ # TODO: replace tox.ini with what the Makefile does
49+ # to make sure local testing is
50+ # identical to github actions which uses tox.ini
4851 - name : Test with tox
4952 env :
5053 # make sure to tell tox to use these environs in tox.ini
Original file line number Diff line number Diff line change 1+ FROM python:3
2+
3+ COPY . /usr/src/labelbox
4+ WORKDIR /usr/src/labelbox
5+
6+ RUN pip install pytest
7+ RUN python setup.py install
Original file line number Diff line number Diff line change 1+
2+ build :
3+ docker build -t local/labelbox-python:test .
4+
5+ test-staging : build
6+ docker run -it -v ${PWD} :/usr/src -w /usr/src \
7+ -e LABELBOX_TEST_ENVIRON=" staging" \
8+ -e LABELBOX_TEST_ENDPOINT=" https://staging-api.labelbox.com/graphql" \
9+ -e LABELBOX_TEST_API_KEY=" <REPLACE>" \
10+ local/labelbox-python:test pytest $(PATH_TO_TEST )
11+
12+ test-prod : build
13+ docker run -it -v ${PWD} :/usr/src -w /usr/src \
14+ -e LABELBOX_TEST_ENVIRON=" prod" \
15+ -e LABELBOX_TEST_ENDPOINT=" https://api.labelbox.com/graphql" \
16+ -e LABELBOX_TEST_API_KEY=" <REPLACE>"
17+ local/labelbox-python:test pytest $(PATH_TO_TEST )
Original file line number Diff line number Diff line change @@ -32,3 +32,20 @@ client = Client()
3232
3333## Repo Organization and Contribution
3434Please consult ` CONTRIB.md `
35+
36+ ## Testing
37+ 1 . Update the ` Makefile ` with your ` staging ` or ` prod ` API key. Make sure the key is not from a free tier account.
38+ 2 . To test on ` staging ` :
39+ ```
40+ make test-staging
41+ ```
42+
43+ 3 . To test on ` prod ` :
44+ ```
45+ make test-prod
46+ ```
47+
48+ 4 . If you make any changes and need to rebuild the image used for testing, force a rebuild with the ` -B ` flag
49+ ```
50+ make -B {build|test-staging|test_prod}
51+ ```
You can’t perform that action at this time.
0 commit comments