Skip to content

Commit 2d937b0

Browse files
authored
Merge pull request #8 from martinRenou/ui-tests
UI testing with Galata
2 parents 5cb80e8 + 89f46e2 commit 2d937b0

71 files changed

Lines changed: 5224 additions & 58 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 25 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,31 @@ jobs:
8585
- name: JavaScript prettyfier
8686
run: yarn run prettier:check
8787

88+
- name: Install Galata
89+
run: yarn install
90+
working-directory: ui-tests
91+
92+
- name: Launch JupyterLab
93+
run: yarn run start-jlab:detached
94+
working-directory: ui-tests
95+
96+
- name: Wait for JupyterLab
97+
uses: ifaxity/wait-on-action@v1
98+
with:
99+
resource: http-get://localhost:8888/api
100+
timeout: 20000
101+
102+
- name: Run UI Tests
103+
run: yarn run test
104+
working-directory: ui-tests
105+
106+
- name: Upload UI Test artifacts
107+
if: always()
108+
uses: actions/upload-artifact@v2
109+
with:
110+
name: ui-test-output
111+
path: ui-tests/test-output
112+
88113
# - name: JavaScript tests
89114
# run: yarn run test
90115
# working-directory: js
@@ -106,58 +131,6 @@ jobs:
106131
name: dist ${{ github.run_number }}
107132
path: ./dist
108133

109-
# visual-regression-tests:
110-
# runs-on: ubuntu-latest
111-
# needs: [build]
112-
113-
# steps:
114-
# - name: Checkout
115-
# uses: actions/checkout@v2
116-
117-
# - name: Setup conda
118-
# uses: conda-incubator/setup-miniconda@v2
119-
# with:
120-
# activate-environment: bqplot-test
121-
# environment-file: test-environment.yml
122-
# python-version: 3.9
123-
# mamba-version: "*"
124-
# auto-activate-base: false
125-
# channels: conda-forge
126-
127-
# - uses: actions/download-artifact@v2
128-
# with:
129-
# name: dist ${{ github.run_number }}
130-
# path: ./dist
131-
132-
# - name: Install the package
133-
# run: pip install -vv bqplot*.whl
134-
# working-directory: dist
135-
136-
# - name: Install Galata
137-
# run: yarn install
138-
# working-directory: ui-tests
139-
140-
# - name: Launch JupyterLab
141-
# run: yarn run start-jlab:detached
142-
# working-directory: ui-tests
143-
144-
# - name: Wait for JupyterLab
145-
# uses: ifaxity/wait-on-action@v1
146-
# with:
147-
# resource: http-get://localhost:8888/api
148-
# timeout: 20000
149-
150-
# - name: Run UI Tests
151-
# run: yarn run test
152-
# working-directory: ui-tests
153-
154-
# - name: Upload UI Test artifacts
155-
# if: always()
156-
# uses: actions/upload-artifact@v2
157-
# with:
158-
# name: ui-test-output
159-
# path: ui-tests/test-output
160-
161134
install:
162135
runs-on: ${{ matrix.os }}-latest
163136
needs: [build]

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,5 @@ bqplot_gl/labextension/*.tgz
154154

155155
# Packed lab extensions
156156
bqplot_gl/labextension
157+
158+
ui-tests/test-output/*

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ module.exports = {
99
},
1010
},
1111
],
12+
'@babel/preset-typescript',
1213
],
1314
};

bqplot_gl/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# Copyright (c) The bqplot Development Team.
55
# Distributed under the terms of the Modified BSD License.
66

7-
version_info = (0, 1, 0, 'dev')
7+
version_info = (0, 1, 0)
88
__version__ = ".".join(map(str, version_info))

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"devDependencies": {
6262
"@babel/core": "^7.5.0",
6363
"@babel/preset-env": "^7.5.0",
64+
"@babel/preset-typescript": "^7.15.0",
6465
"@jupyterlab/builder": "^3.0.0",
6566
"@phosphor/application": "^1.6.0",
6667
"@phosphor/widgets": "^1.6.0",

src/ScatterGLView.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* limitations under the License.
1414
*/
1515

16+
import { ColorScale } from 'bqscales';
1617
import { Mark, symbol as bqSymbol, deepCopy, Scale } from 'bqplot';
1718
import * as d3 from 'd3';
1819
import * as _ from 'underscore';
@@ -56,9 +57,9 @@ const color_to_array_rgba = function (color: any, default_color?: any) {
5657
}
5758
};
5859

59-
const create_colormap = function (scale: any) {
60+
const create_colormap = function (scale: ColorScale) {
6061
// convert the d3 color scale to a texture
61-
const colors = scale ? scale.model.color_range : ['#ff0000', '#ff0000'];
62+
const colors = scale ? scale.model.colorRange : [0, 1];
6263
const color_scale = d3
6364
.scaleLinear()
6465
.range(colors)

src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Widget } from '@phosphor/widgets';
77

88
import { IJupyterWidgetRegistry } from '@jupyter-widgets/base';
99

10-
import * as widgetExports from './figure';
10+
import * as widgetExports from './index';
1111

1212
import { MODULE_NAME, MODULE_VERSION } from './version';
1313

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"declaration": true,
4-
"esModuleInterop":true,
4+
"esModuleInterop": true,
55
"lib": ["es2015", "dom"],
66
"module": "commonjs",
77
"moduleResolution": "node",

ui-tests/README.md

Lines changed: 36 additions & 0 deletions

ui-tests/galata-config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"testId": "test"
3+
}

0 commit comments

Comments
 (0)