Skip to content

Commit 0182e05

Browse files
committed
Fix automated tests
1 parent f302877 commit 0182e05

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

.github/workflows/push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- name: Build multi-arch apk Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
6464
run: |
6565
mkdir -p apks
66-
make docker/run/make/with-artifact/testapps-with-numpy
66+
make docker/run/make/with-artifact/apk/testapps-with-numpy
6767
- uses: actions/upload-artifact@v1
6868
with:
6969
name: bdist_unit_tests_app-debug-1.1-.apk
@@ -91,7 +91,7 @@ jobs:
9191
- name: Build Android App Bundle Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
9292
run: |
9393
mkdir -p aabs
94-
make docker/run/make/with-artifact/testapps-with-numpy-aab
94+
make docker/run/make/with-artifact/aab/testapps-with-numpy-aab
9595
- uses: actions/upload-artifact@v1
9696
with:
9797
name: bdist_unit_tests_app-release-1.1-.aab

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,18 @@ docker/run/test: docker/build
7474
docker/run/command: docker/build
7575
docker run --rm --env-file=.env $(DOCKER_IMAGE) /bin/sh -c "$(COMMAND)"
7676

77-
docker/run/make/%: docker/build
78-
docker run --rm --env-file=.env $(DOCKER_IMAGE) make $*
77+
docker/run/make/with-artifact/apk/%: docker/build
78+
docker run --name p4a-latest --env-file=.env $(DOCKER_IMAGE) make $*
79+
docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/bdist_unit_tests_app-debug-1.1-.apk ./apks
80+
docker rm -fv p4a-latest
7981

80-
docker/run/make/with-artifact/%: docker/build
81-
$(eval $@_APP_ARCH := $(shell basename $*))
82+
docker/run/make/with-artifact/aab/%: docker/build
8283
docker run --name p4a-latest --env-file=.env $(DOCKER_IMAGE) make $*
83-
docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/bdist_unit_tests_app__$($@_APP_ARCH)-debug-1.1-.apk ./apks
84+
docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/bdist_unit_tests_app-release-1.1-.aab ./aabs
8485
docker rm -fv p4a-latest
8586

87+
docker/run/make/%: docker/build
88+
docker run --rm --env-file=.env $(DOCKER_IMAGE) make $*
89+
8690
docker/run/shell: docker/build
8791
docker run --rm --env-file=.env -it $(DOCKER_IMAGE)

pythonforandroid/bdistapk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def _set_user_options():
164164
user_options.append((arg[2:], None, None))
165165

166166
BdistAPK.user_options = user_options
167+
BdistAAB.user_options = user_options
167168

168169

169170
_set_user_options()

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def recursively_include(results, directory, patterns):
103103
'distutils.commands': [
104104
'apk = pythonforandroid.bdistapk:BdistAPK',
105105
'aar = pythonforandroid.bdistapk:BdistAAR',
106+
'aab = pythonforandroid.bdistapk:BdistAAB',
106107
],
107108
},
108109
classifiers=[

testapps/on_device_unit_tests/setup.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@
3838
# define a basic test app, which can be override passing the proper args to cli
3939
options = {
4040
'apk':
41+
{
42+
'requirements':
43+
'sqlite3,libffi,openssl,pyjnius,kivy,python3,requests,urllib3,'
44+
'chardet,idna',
45+
'android-api': 27,
46+
'ndk-api': 21,
47+
'dist-name': 'bdist_unit_tests_app',
48+
'arch': 'armeabi-v7a',
49+
'bootstrap' : 'sdl2',
50+
'permissions': ['INTERNET', 'VIBRATE'],
51+
'orientation': 'sensor',
52+
'service': 'P4a_test_service:app_service.py',
53+
},
54+
'aab':
4155
{
4256
'requirements':
4357
'sqlite3,libffi,openssl,pyjnius,kivy,python3,requests,urllib3,'

0 commit comments

Comments
 (0)