Skip to content

Commit

Permalink
Make test-integration job use pre-existing build
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsmith committed Jul 19, 2023
1 parent 26ec8ae commit 3f85e74
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 49 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ jobs:
done
- name: Install Python requirements
run: pip install -r product/runtime/requirements-build.txt
run: |
python$(target/list-versions.py --default) -m \
pip install -r product/runtime/requirements-build.txt
# TODO: move versions to a single location used by both CI and
# runtime/build.gradle. COMPILE_SDK_VERSION can then be removed from Common.java,
Expand Down Expand Up @@ -116,4 +118,4 @@ jobs:
- name: Test
run: |
cd product
./gradlew testIntegration-${{ matrix.agp-version }}
CHAQUOPY_NO_BUILD=1 ./gradlew testIntegration-${{ matrix.agp-version }}
6 changes: 4 additions & 2 deletions product/gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,11 @@ for (f in file("$INTEGRATION_DIR/data").listFiles()) {
def version = it[1]
def task = testPythonTask("testIntegration-$version",
Common.DEFAULT_PYTHON_VERSION) {
dependsOn publish, ":runtime:publish"
if (System.getenv("CHAQUOPY_NO_BUILD") == null) { // Used in CI
dependsOn publish, ":runtime:publish"
}
workingDir INTEGRATION_DIR
environment "AGP_VERSION", version
environment "CHAQUOPY_AGP_VERSION", version
}
testIntegration.dependsOn(task)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from contextlib import contextmanager
from distutils import dir_util
import distutils.util
from fnmatch import fnmatch
import hashlib
import json
Expand Down Expand Up @@ -80,7 +79,7 @@ def run_build_python(args, **kwargs):


# Android Gradle Plugin version (passed from Gradle task).
agp_version = os.environ["AGP_VERSION"]
agp_version = os.environ["CHAQUOPY_AGP_VERSION"]
agp_version_info = tuple(map(int, agp_version.split(".")))

# This pattern causes Android Studio to show the line as a warning in tree view. However, the
Expand Down Expand Up @@ -853,7 +852,7 @@ def test_isolated_env(self):
# Pip configuration files should have no effect.
def test_isolated_config(self):
config_filename = join(appdirs.user_config_dir("pip", appauthor=False, roaming=True),
"pip.ini" if (os.name == "nt") else "pip.conf")
"pip.ini" if (os.name == "nt") else "pip.conf")
config_backup = f"{config_filename}.{os.getpid()}"
os.makedirs(dirname(config_filename), exist_ok=True)
if exists(config_filename):
Expand Down Expand Up @@ -1733,7 +1732,7 @@ def check_assets(self, apk_dir, kwargs):
with open(join(asset_dir, "build.json")) as build_json_file:
build_json = json.load(build_json_file)
self.test.assertCountEqual(["python_version", "assets", "extract_packages"],
build_json)
build_json)
self.test.assertEqual(python_version, build_json["python_version"])
self.test.assertCountEqual(extract_packages, build_json["extract_packages"])
asset_list = []
Expand Down
5 changes: 3 additions & 2 deletions product/runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ String sdkPath(String path) {
return absPath
}

def ndkDir = sdkPath("ndk/22.1.7171670") // Should match the version in target/build-common.sh.

// Android Studio 4.2 no longer comes with JNI headers, so build against an older JRE. Also,
// some of the Python unit tests don't work on Java 11 yet (#5727).
//
Expand Down Expand Up @@ -276,6 +274,8 @@ for (abi in ["host"] + Common.ABIS) {
args ("-DCHAQUOPY_INCLUDE_JAVA=$javaHome/include;" +
"$javaHome/include/$javaIncludeSubdir")
} else {
// Should match the version in target/build-common.sh.
def ndkDir = sdkPath("ndk/22.1.7171670")
def prefixDir = "$projectDir/../../target/prefix/$abi"
args "-DCMAKE_TOOLCHAIN_FILE=$ndkDir/build/cmake/android.toolchain.cmake",
"-DANDROID_ABI=$abi", "-DANDROID_STL=system",
Expand Down Expand Up @@ -397,6 +397,7 @@ for (abi in ["host"] + Common.ABIS) {
}
}

// Requires the Python packages in requirements-docs.txt.
task("sphinx", type: Exec, group: "documentation") {
// We call a specific Python executable rather than running `sphinx-build`,
// because Sphinx needs to be able to import the runtime module.
Expand Down
39 changes: 0 additions & 39 deletions product/runtime/requirements-build.txt
Original file line number Diff line number Diff line change
@@ -1,40 +1 @@
# Direct requirements
Cython==0.29.32
flake8==3.8.4
furo==2022.4.7
Sphinx==4.5.0
sphinx-better-subsection==0.1
towncrier==22.12.0

# Indirect requirements
alabaster==0.7.12
Babel==2.10.1
beautifulsoup4==4.11.1
certifi==2021.10.8
charset-normalizer==2.0.12
click==8.1.3
click-default-group==1.2.2
colorama==0.4.4
docutils==0.17.1
idna==3.3
imagesize==1.3.0
importlib-metadata==4.11.3
incremental==22.10.0
Jinja2==3.1.1
MarkupSafe==2.1.1
packaging==21.3
Pygments==2.12.0
pyparsing==3.0.8
pytz==2022.1
requests==2.27.1
snowballstemmer==2.2.0
soupsieve==2.3.2.post1
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==2.0.1
urllib3==1.26.9
zipp==3.8.0
39 changes: 39 additions & 0 deletions product/runtime/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

# Direct requirements
furo==2022.4.7
Sphinx==4.5.0
sphinx-better-subsection==0.1
towncrier==22.12.0

# Indirect requirements
alabaster==0.7.12
Babel==2.10.1
beautifulsoup4==4.11.1
certifi==2021.10.8
charset-normalizer==2.0.12
click==8.1.3
click-default-group==1.2.2
colorama==0.4.4
docutils==0.17.1
idna==3.3
imagesize==1.3.0
importlib-metadata==4.11.3
incremental==22.10.0
Jinja2==3.1.1
MarkupSafe==2.1.1
packaging==21.3
Pygments==2.12.0
pyparsing==3.0.8
pytz==2022.1
requests==2.27.1
snowballstemmer==2.2.0
soupsieve==2.3.2.post1
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==2.0.1
urllib3==1.26.9
zipp==3.8.0

0 comments on commit 3f85e74

Please sign in to comment.