Browse Source

fix test and add it to ci

Steven Silvester 5 years ago
parent
commit
20cae2fd32

+ 1 - 1
.github/workflows/linuxjs-tests.yml

@@ -7,7 +7,7 @@ jobs:
     name: JS
     strategy:
       matrix:
-        group: [js-services, js-application, js-apputils, js-cells, js-codeeditor, js-codemirror, js-completer, js-console, js-coreutils, js-csvviewer, js-docmanager, js-docregistry, js-filebrowser, js-fileeditor, js-imageviewer, js-inspector, js-logconsole, js-mainmenu, js-nbformat, js-notebook, js-observables, js-outputarea, js-rendermime,  js-settingregistry, js-statedb, js-statusbar, js-terminal, js-ui-components]
+        group: [js-services, js-application, js-apputils, js-cells, js-codeeditor, js-codemirror, js-completer, js-console, js-coreutils, js-csvviewer, js-docmanager, js-docregistry, js-filebrowser, js-fileeditor, js-imageviewer, js-inspector, js-logconsole, js-mainmenu, js-nbformat, js-notebook, js-observables, js-outputarea, js-rendermime,  js-settingregistry, js-statedb, js-statusbar, js-terminal, js-ui-components, js-testutils]
       fail-fast: false
     runs-on: ubuntu-latest
     steps:

+ 8 - 12
scripts/ci_script.sh

@@ -19,9 +19,14 @@ fi
 
 if [[ $GROUP == js* ]]; then
 
-    # extract the group name
-    export PKG="${GROUP#*-}"
-    pushd packages/${PKG}
+    if [[ $GROUP === "js-testutils" ]]; then
+        pushd testutils
+    else
+        # extract the group name
+        export PKG="${GROUP#*-}"
+        pushd packages/${PKG}
+    fi
+
     jlpm run build:test; true
 
     export FORCE_COLOR=1
@@ -30,15 +35,6 @@ if [[ $GROUP == js* ]]; then
     jlpm run clean
 fi
 
-if [[ $GROUP == jsscope ]]; then
-
-    jlpm build:packages
-    jlpm build:test
-    FORCE_COLOR=1 jlpm test:scope --loglevel success --scope $JSTESTGROUP
-
-    jlpm run clean
-fi
-
 
 if [[ $GROUP == docs ]]; then
     # Verify tutorial docs build

+ 2 - 6
testutils/test/mock.spec.ts

@@ -630,16 +630,12 @@ describe('mock', () => {
 
   describe('createFileContext()', () => {
     it('should create a context without a kernel', async () => {
-      const context = Mock.createFileContext();
-      await context.initialize(true);
-      await context.sessionContext.initialize();
+      const context = await Mock.createFileContext();
       expect(context.sessionContext.session).toBe(null);
     });
 
     it('should create a context with a kernel', async () => {
-      const context = Mock.createFileContext(true);
-      await context.initialize(true);
-      await context.sessionContext.initialize();
+      const context = await Mock.createFileContext(true);
       expect(context.sessionContext.session!.kernel!.name).toBe(
         Mock.DEFAULT_NAME
       );

+ 1 - 0
testutils/test/start_jupyter_server.spec.ts

@@ -10,6 +10,7 @@ import { URLExt } from '@jupyterlab/coreutils';
 
 describe('JupyterServer', () => {
   it('should start the server', async () => {
+    jest.setTimeout(20000);
     const server = new JupyterServer();
     const url = await server.start();
     await fetch(URLExt.join(url, 'api'));