Skip to content

Commit f8d0688

Browse files
committed
[SPARK-35393][PYTHON][INFRA][TESTS] Recover pip packaging test in Github Actions
Currently pip packaging test is being skipped: ``` ======================================================================== Running PySpark packaging tests ======================================================================== Constructing virtual env for testing Missing virtualenv & conda, skipping pip installability tests Cleaning up temporary directory - /tmp/tmp.iILYWISPXW ``` See https://github.com/apache/spark/runs/2568923639?check_suite_focus=true GitHub Actions's image has its default Conda installed at `/usr/share/miniconda` but seems like the image we're using for PySpark does not have it (which is legitimate). This PR proposes to install Conda to use in pip packaging tests in GitHub Actions. To recover the test coverage. No, dev-only. It was tested in my fork: https://github.com/HyukjinKwon/spark/runs/2575126882?check_suite_focus=true ``` ======================================================================== Running PySpark packaging tests ======================================================================== Constructing virtual env for testing Using conda virtual environments Testing pip installation with python 3.6 Using /tmp/tmp.qPjTenqfGn for virtualenv Collecting package metadata (current_repodata.json): ...working... done Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): ...working... done Solving environment: ...working... done environment location: /tmp/tmp.qPjTenqfGn/3.6 added / updated specs: - numpy - pandas - pip - python=3.6 - setuptools ... Successfully ran pip sanity check ``` Closes #32537 from HyukjinKwon/SPARK-35393. Authored-by: Hyukjin Kwon <gurwls223@apache.org> Signed-off-by: Dongjoon Hyun <dhyun@apple.com> (cherry picked from commit 7d371d2) Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
1 parent ce8922d commit f8d0688

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

.github/workflows/build_and_test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ jobs:
7676
INCLUDED_TAGS: ${{ matrix.included-tags }}
7777
HADOOP_PROFILE: ${{ matrix.hadoop }}
7878
HIVE_PROFILE: ${{ matrix.hive }}
79-
# GitHub Actions' default miniconda to use in pip packaging test.
80-
CONDA_PREFIX: /usr/share/miniconda
8179
GITHUB_PREV_SHA: ${{ github.event.before }}
8280
SPARK_LOCAL_IP: localhost
8381
steps:
@@ -160,8 +158,6 @@ jobs:
160158
MODULES_TO_TEST: ${{ matrix.modules }}
161159
HADOOP_PROFILE: hadoop2.7
162160
HIVE_PROFILE: hive2.3
163-
# GitHub Actions' default miniconda to use in pip packaging test.
164-
CONDA_PREFIX: /usr/share/miniconda
165161
GITHUB_PREV_SHA: ${{ github.event.before }}
166162
SPARK_LOCAL_IP: localhost
167163
steps:
@@ -195,13 +191,18 @@ jobs:
195191
with:
196192
python-version: 2.7
197193
architecture: x64
198-
- name: Install Python packages (Python 2.7 )
194+
- name: Install Python packages (Python 2.7)
199195
run: |
200196
python2.7 -m pip install numpy 'pyarrow<3.0.0' pandas scipy xmlrunner
201197
python2.7 -m pip list
198+
- name: Install Conda for pip packaging test
199+
run: |
200+
curl -s https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh > miniconda.sh
201+
bash miniconda.sh -b -p $HOME/miniconda
202202
# Run the tests.
203203
- name: Run tests
204204
run: |
205+
export PATH=$PATH:$HOME/miniconda/bin
205206
./dev/run-tests --parallelism 2 --modules "$MODULES_TO_TEST"
206207
- name: Upload test results to report
207208
if: always()

dev/run-pip-tests

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ for python in "${PYTHON_EXECS[@]}"; do
8080
VIRTUALENV_PATH="$VIRTUALENV_BASE"/$python
8181
rm -rf "$VIRTUALENV_PATH"
8282
if [ -n "$USE_CONDA" ]; then
83-
if [ -f "$CONDA_PREFIX/etc/profile.d/conda.sh" ]; then
84-
# See also https://github.com/conda/conda/issues/7980
85-
source "$CONDA_PREFIX/etc/profile.d/conda.sh"
86-
fi
8783
conda create -y -p "$VIRTUALENV_PATH" python=$python numpy pandas pip setuptools
8884
source activate "$VIRTUALENV_PATH" || conda activate "$VIRTUALENV_PATH"
8985
else

0 commit comments

Comments
 (0)