Skip to content

Commit

Permalink
Fix tests staleness, Jupyter tests and over-build
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Stein <[email protected]>
  • Loading branch information
texodus committed Oct 14, 2024
1 parent 73aeba9 commit 5a73fe8
Show file tree
Hide file tree
Showing 47 changed files with 603 additions and 484 deletions.
19 changes: 17 additions & 2 deletions .github/actions/install-deps/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ inputs:
python:
default: "true"
description: "Install Python dependencies?"
playwright:
default: "false"
description: "Install browsers for playwright testing"
clean:
default: "false"
description: "Clean unused deps. This is helpful if we run out of HD but slow!"
Expand Down Expand Up @@ -117,13 +120,25 @@ runs:
vcpkg.exe integrate install
echo "VCPKG_INSTALLATION_ROOT=${env:VCPKG_INSTALLATION_ROOT}"
echo "VCPKG_INSTALLATION_ROOT=${env:VCPKG_INSTALLATION_ROOT}" >> $env:GITHUB_OUTPUT
echo "${env:VCPKG_INSTALLATION_ROOT}" >> $env:GITHUB_PATH
echo "VCPKG_ROOT=${env:VCPKG_INSTALLATION_ROOT}" >> $env:GITHUB_ENV
dir env:
env:
PYTHON_VERSION: ${{ matrix.python-version }}
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_PLATFORM_TOOLSET: v143
if: ${{ runner.os == 'Windows' && inputs.cpp == 'true' }}

# https://github.com/apache/arrow/issues/38391
- if: ${{ runner.os == 'macOS' }}
shell: bash
run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)" >> $GITHUB_ENV

# Use python 3.9 from manylinu
- run: echo "/opt/python/cp39-cp39/bin" >> $GITHUB_PATH
shell: bash
if: ${{ runner.os == 'Linux' }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
if: ${{ inputs.python == 'true' && runner.os != 'Linux' }}
Expand Down Expand Up @@ -179,12 +194,12 @@ runs:

- name: Install JS dependencies
shell: bash
if: ${{ inputs.javascript == 'true' }}
if: ${{ inputs.javascript == 'true' && inputs.playwright == 'true' }}
run: pnpm install

- name: Install JS dependencies
shell: bash
if: ${{ inputs.javascript == 'false' }}
if: ${{ inputs.javascript == 'false' || inputs.playwright == 'false'}}
run: pnpm install --ignore-scripts

- name: Install Python dependencies
Expand Down
32 changes: 7 additions & 25 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ jobs:
with:
name: perspective-metadata
path: |
rust/perspective-server/cpp/
rust/perspective-server/cmake/
rust/perspective-client/src/
rust/perspective-client/docs/
rust/perspective-js/src/ts/
Expand Down Expand Up @@ -146,6 +148,7 @@ jobs:
with:
clean: "true"
python: "false"
playwright: "true"
skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }}

- name: WebAssembly Build
Expand All @@ -154,13 +157,6 @@ jobs:
PACKAGE: "perspective-cpp,perspective,perspective-viewer,perspective-viewer-datagrid,perspective-viewer-d3fc,perspective-viewer-openlayers,perspective-workspace,perspective-cli"
# PSP_USE_CCACHE: 1


# - name: Docs Build
# run: pnpm run docs

# env:
# PACKAGE: "!perspective-python,!perspective-jupyterlab"

- uses: actions/upload-artifact@v4
with:
name: perspective-js-dist
Expand Down Expand Up @@ -238,16 +234,6 @@ jobs:
manylinux: ${{ matrix.container && 'true' || 'false' }}
skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }}

- run: echo "/opt/python/cp39-cp39/bin" >> $GITHUB_PATH
if: ${{ runner.os == 'Linux' }}

# https://github.com/apache/arrow/issues/38391
- if: ${{ runner.os == 'macOS' }}
run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)" >> $GITHUB_ENV

- run: echo "${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}" >> $env:GITHUB_PATH
if: ${{ runner.os == 'Windows' }}

- name: Python Build
run: pnpm run build
if: ${{ !contains(matrix.os, 'windows') }}
Expand All @@ -265,7 +251,6 @@ jobs:
env:
CARGO_TARGET_DIR: D:\psp-rust
PSP_ROOT_DIR: ${{ github.workspace }}
VCPKG_ROOT: ${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}
PACKAGE: "perspective-python"
PSP_ARCH: ${{ matrix.arch }}
PSP_BUILD_WHEEL: 1
Expand Down Expand Up @@ -332,25 +317,21 @@ jobs:
manylinux: "false"
skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }}

- run: echo "${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}" >> $env:GITHUB_PATH
if: ${{ runner.os == 'Windows' }}

- name: Rust Build
run: pnpm run build
if: ${{ !contains(matrix.os, 'windows') }}
env:
PACKAGE: "perspective-rs"
PSP_ROOT_DIR: ${{ github.workspace }}

- name: Python Build (Windows)
- name: Rust Build (Windows)
run: |
New-Item -ItemType Directory -Path $env:CARGO_TARGET_DIR -Force
pnpm run build
if: ${{ contains(matrix.os, 'windows') }}
env:
CARGO_TARGET_DIR: D:\psp-rust
PSP_ROOT_DIR: ${{ github.workspace }}
VCPKG_ROOT: ${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}
PACKAGE: "perspective-rs"

- name: Rust Test
Expand All @@ -368,7 +349,6 @@ jobs:
env:
CARGO_TARGET_DIR: D:\psp-rust
PSP_ROOT_DIR: ${{ github.workspace }}
VCPKG_ROOT: ${{ steps.init-step.outputs.VCPKG_INSTALLATION_ROOT }}
PACKAGE: "perspective-rs"

- name: Package
Expand Down Expand Up @@ -542,6 +522,7 @@ jobs:

- name: Run Jupyter Tests
if: ${{ false }}
# if: ${{ runner.os == 'Linux' }}
run: |
jupyter lab --generate-config
pnpm run test --jupyter
Expand Down Expand Up @@ -581,6 +562,7 @@ jobs:
python: "false"
rust: "false"
cpp: "false"
playwright: "true"
skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }}

- uses: actions/download-artifact@v4
Expand All @@ -591,7 +573,7 @@ jobs:
- name: Run Tests
run: pnpm run test
env:
PACKAGE: "!perspective-python,!perspective-jupyterlab"
PACKAGE: "perspective-cpp,perspective,perspective-viewer,perspective-viewer-datagrid,perspective-viewer-d3fc,perspective-viewer-openlayers,perspective-workspace,perspective-cli"
# PSP_USE_CCACHE: 1

# ,--,--' . .-,--. . .
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ ts-rs/
rust/perspective-python/perspective/labextension/
rust/perspective-python/perspective.data/
rust/perspective-python/*/data
expression_gen.md
expression_gen.md
rust/perspective-viewer/docs/exprtk.md
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,26 @@

[workspace]
resolver = "2"
default-members = [
"rust/perspective",
"rust/perspective-client",
"rust/perspective-js",
"rust/perspective-python",
"rust/perspective-server",
"rust/perspective-viewer",
]
members = [
"rust/lint",
"rust/generate-metadata",
"rust/bootstrap",
"rust/bootstrap-runtime",
"rust/perspective-viewer",
"rust/bundle",
"rust/perspective",
"rust/perspective-client",
"rust/perspective-js",
"rust/perspective-python",
"rust/perspective-server",
"rust/perspective-viewer",
"examples/rust-axum",
]

Expand Down
4 changes: 4 additions & 0 deletions cpp/perspective/src/cpp/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ ServerResources::get_view(const t_id& id) {

void
ServerResources::delete_view(const std::uint32_t& client_id, const t_id& id) {
if (!m_view_to_table.contains(id)) {
throw PerspectiveViewNotFoundException();
}

{
PSP_WRITE_LOCK(m_write_lock);
auto table_id = m_view_to_table.at(id);
Expand Down
70 changes: 35 additions & 35 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const config = {
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve("./sidebars.js"),
// sidebarPath: require.resolve("./sidebars.js"),
docItemComponent: require.resolve(
"./src/components/DocItem"
),
Expand Down Expand Up @@ -112,13 +112,13 @@ const config = {
src: "svg/perspective-logo-light.svg",
},
items: [
// {to: "/blog", label: "News", position: "right"},
{
type: "doc",
docId: "js",
position: "right",
label: "Docs",
},
{ to: "/blog", label: "News", position: "right" },
// {
// type: "doc",
// docId: "js",
// position: "right",
// label: "Docs",
// },
{
to: "/examples",
position: "right",
Expand All @@ -138,33 +138,33 @@ const config = {
},
footer: {
links: [
{
title: "Docs",
items: [
{
label: "JavaScript User Guide",
to: "/docs/js",
},
{
label: "Python User Guide",
to: "/docs/python",
},
],
},
{
title: "More",
items: [
{
label: "GitHub",
href: "https://github.com/finos/perspective",
},
{
href: "https://www.prospective.co/blog",
label: "Blog",
position: "right",
},
],
},
// {
// title: "Docs",
// items: [
// {
// label: "JavaScript User Guide",
// to: "/docs/js",
// },
// {
// label: "Python User Guide",
// to: "/docs/python",
// },
// ],
// },
// {
// title: "More",
// items: [
// {
// label: "GitHub",
// href: "https://github.com/finos/perspective",
// },
// {
// href: "https://www.prospective.co/blog",
// label: "Blog",
// position: "right",
// },
// ],
// },
],
copyright: `Copyright © ${new Date().getFullYear()} The Perspective Authors`,
},
Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "3.1.0",
"private": true,
"scripts": {
"build": "node build.js && docusaurus build",
"docusaurus": "docusaurus",
"start": "docusaurus start",
"docs": "node build.js && docusaurus build",
Expand Down
14 changes: 7 additions & 7 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
// tutorialSidebar: [{type: "autogenerated", dirName: "."}],
tutorialSidebar: [
{
type: "category",
label: "Language Guides",
items: ["js", "python"],
},
// {
// type: "category",
// label: "Language Guides",
// items: ["js", "python"],
// },
{
type: "category",
label: "API",
items: [
"expressions",
"server",
// "server",
{
type: "link",
label: "`perspective` Rust API",
Expand Down Expand Up @@ -55,7 +55,7 @@ const sidebars = {
},
],
},
"development",
// "development",
],

// ["js", "python", "table", "view", "server", "development"],
Expand Down
Empty file added docs/static/404.html
Empty file.
3 changes: 3 additions & 0 deletions examples/workspace/src/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@import "~@finos/perspective-workspace/dist/css/pro-dark.css";
@import "~@finos/perspective-viewer/dist/css/themes.css";

body {
display: flex;
flex-direction: column;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"preinstall": "npx only-allow pnpm",
"postinstall": "npm-run-all postinstall:*",
"postinstall:emsdk": "node tools/perspective-scripts/install_emsdk.mjs",
"postinstall:playwright": "npx playwright install --with-deps",
"postinstall:playwright": "npx playwright install --with-deps chromium",
"postinstall:vscode": "cp -n ./.vscode/settings.default.json ./.vscode/settings.json || true",
"install_llvm": "node tools/perspective-scripts/install_llvm.mjs",
"install_pyodide": "node tools/perspective-scripts/install_pyodide.mjs",
Expand All @@ -95,7 +95,7 @@
"_wheel_python": "node tools/perspective-scripts/_wheel_python.mjs",
"_requires_python": "node tools/perspective-scripts/_requires_python.mjs",
"setup": "node tools/perspective-scripts/setup.mjs",
"docs": "cargo doc --no-deps",
"docs": "node tools/perspective-scripts/docs.mjs",
"test": "node tools/perspective-scripts/test.mjs",
"test:jupyter": "pnpm run --recursive --filter @finos/perspective-jupyterlab test:jupyter",
"test_js": "node tools/perspective-scripts/test_js.mjs",
Expand Down
3 changes: 2 additions & 1 deletion packages/perspective-jupyterlab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"@jupyterlab/builder": "^4",
"copy-webpack-plugin": "~12",
"@prospective.co/procss": "^0.1.16",
"cpy": "^9.0.1"
"cpy": "^9.0.1",
"zx": "^8.1.8"
},
"jupyterlab": {
"webpackConfig": "./webpack.config.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

import { start_jlab, kill_jlab } from "./jlab_start.mjs";
import { start_jlab, kill_jlab } from "./jlab_start.ts";

async function globalSetup() {
// Start Jupyterlab in the background
Expand Down
Loading

0 comments on commit 5a73fe8

Please sign in to comment.