Skip to content

Commit

Permalink
E2E test: fix tests for ubuntu 24 (#6038)
Browse files Browse the repository at this point in the history
Various fixes related to the upgrade of our CI runners to Ubuntu 24:
* Don't install Python 3.10
* Use Python 3.12 for tests
* Provide --no-sandbox param for integration tests
* Alter App Armor to allow Playwright to launch Electron
* Stop using pydataset because of problems installing it

Fix related to upstream merge
* update plot base images

### QA Notes

All tests should pass.
  • Loading branch information
testlabauto authored Jan 17, 2025
1 parent fefd5f8 commit 25fcbfb
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 34 deletions.
26 changes: 1 addition & 25 deletions .github/actions/install-python/action.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,8 @@
name: "Setup Python"
description: "Install specified Python version."
inputs:
version:
description: "The version of Python to install (e.g., 3.10)"
required: true
default: "3.10"
description: "Install Python dependencies."
runs:
using: "composite"
steps:
- name: Install Specified Python Version
shell: bash
run: |
# Extract Python version from input
PYTHON_VERSION="${{ inputs.version }}"
# Add the deadsnakes PPA repository and update apt
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
# Install the specific Python version and necessary packages
sudo apt-get install -y \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-venv
# Set up update-alternatives for managing multiple Python versions
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1
- name: Install Python dependencies
shell: bash
run: |
Expand Down
2 changes: 0 additions & 2 deletions .github/actions/setup-test-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ runs:
- name: Setup Python
uses: ./.github/actions/install-python
with:
version: "3.10"

- name: Setup R
uses: ./.github/actions/install-r
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test-e2e-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ jobs:
uses: ./.github/actions/gen-report-dir
if: ${{ !cancelled() }}

- name: Alter AppArmor Restrictions for Playwright (Electron)
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

- name: Run Playwright Tests (Electron)
env:
POSITRON_PY_VER_SEL: 3.10.12
POSITRON_PY_VER_SEL: 3.12.3
POSITRON_R_VER_SEL: 4.4.0
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_CI_BUILD_ID: ${{ github.run_id }}-${{ github.run_attempt }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Run Tests (Electron)
if: ${{ !cancelled() }}
env:
POSITRON_PY_VER_SEL: 3.10.12
POSITRON_PY_VER_SEL: 3.12.3
POSITRON_R_VER_SEL: 4.4.0
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_CI_BUILD_ID: ${{ github.run_id }}-${{ github.run_attempt }}
Expand Down
4 changes: 2 additions & 2 deletions scripts/test-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else
ROOT=$(dirname $(dirname $(readlink -f $0)))
# --disable-dev-shm-usage: when run on docker containers where size of /dev/shm
# partition < 64MB which causes OOM failure for chromium compositor that uses the partition for shared memory
LINUX_EXTRA_ARGS="--disable-dev-shm-usage"
LINUX_EXTRA_ARGS="--disable-dev-shm-usage --no-sandbox"
fi

VSCODEUSERDATADIR=`mktemp -d 2>/dev/null`
Expand Down Expand Up @@ -71,7 +71,7 @@ npm run test-extension -- -l vscode-colorize-tests
kill_app

echo
echo "### Terminal Suggest tests"
echo "### Terminal Suggest tests"
echo
npm run test-extension -- -l terminal-suggest --enable-proposed-api=vscode.vscode-api-tests
kill_app
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-remote-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else
ROOT=$(dirname $(dirname $(readlink -f $0)))
# --disable-dev-shm-usage: when run on docker containers where size of /dev/shm
# partition < 64MB which causes OOM failure for chromium compositor that uses the partition for shared memory
LINUX_EXTRA_ARGS="--disable-dev-shm-usage"
LINUX_EXTRA_ARGS="--disable-dev-shm-usage --no-sandbox"
fi

VSCODEUSERDATADIR=`mktemp -d 2>/dev/null`
Expand Down
15 changes: 13 additions & 2 deletions test/e2e/tests/data-explorer/data-explorer-python-pandas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,19 @@ df2 = pd.DataFrame(data)`;
test('Python - Open Data Explorer for the second time brings focus back [C1078833]', async function ({ app, python }) {

const script = `import pandas as pd
from pydataset import data
Data_Frame = data('mtcars')`;
Data_Frame = pd.DataFrame({
"mpg": [21.0, 21.0, 22.8, 21.4, 18.7],
"cyl": [6, 6, 4, 6, 8],
"disp": [160.0, 160.0, 108.0, 258.0, 360.0],
"hp": [110, 110, 93, 110, 175],
"drat": [3.90, 3.90, 3.85, 3.08, 3.15],
"wt": [2.62, 2.875, 2.32, 3.215, 3.44],
"qsec": [16.46, 17.02, 18.61, 19.44, 17.02],
"vs": [0, 0, 1, 1, 0],
"am": [1, 1, 1, 0, 0],
"gear": [4, 4, 4, 3, 3],
"carb": [4, 4, 1, 1, 2]
})`;
await app.workbench.console.executeCode('Python', script, '>>>');
await app.workbench.quickaccess.runCommand('workbench.panel.positronVariables.focus');

Expand Down
Binary file modified test/e2e/tests/plots/autos-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/e2e/tests/plots/graphviz-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/e2e/tests/plots/pythonScatterplot-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 25fcbfb

Please sign in to comment.