Browse Source

Backport PR #11391: Improve documentation on galata setup (#11400)

Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com>
MeeseeksMachine 3 years ago
parent
commit
0fcd2f5bfb
4 changed files with 12 additions and 4 deletions
  1. 1 1
      MANIFEST.in
  2. 9 2
      galata/README.md
  3. 1 0
      galata/jupyter_server_test_config.py
  4. 1 1
      galata/package.json

+ 1 - 1
MANIFEST.in

@@ -34,7 +34,7 @@ recursive-exclude jupyterlab *.js.map
 
 # Galata
 include galata/README.md
-include galata/jupyter_server_config.py
+include galata/jupyter_server_test_config.py
 include galata/*.js
 recursive-include galata/media *.*
 graft galata/src

+ 9 - 2
galata/README.md

@@ -26,7 +26,7 @@ jlpm playwright install
 
 Create a Playwright configuration file `playwright.config.js` containing:
 
-```
+```js
 module.exports = require('@jupyterlab/galata/lib/playwright-config');
 ```
 
@@ -66,8 +66,8 @@ Create `jupyter_server_test_config.py` with the following content.
 from tempfile import mkdtemp
 
 c.ServerApp.port = 8888
+c.ServerApp.port_retries = 0
 c.ServerApp.open_browser = False
-c.LabApp.dev_mode = True
 
 c.ServerApp.root_dir = mkdtemp(prefix='galata-test-')
 c.ServerApp.token = ""
@@ -137,6 +137,13 @@ PWDEBUG=1 jlpm playwright test
 
 Here are the new test fixture introduced by Galata on top of [Playwright fixtures](https://playwright.dev/docs/api/class-fixtures).
 
+### baseURL
+
+- type: < string >
+
+Application base URL without `/lab`. It defaults to environment variable `TARGET_URL` or `http://localhost:8888` if nothing
+is defined.
+
 ### appPath
 
 - type: < string >

+ 1 - 0
galata/jupyter_server_config.py → galata/jupyter_server_test_config.py

@@ -6,6 +6,7 @@ if getpass.getuser() == "jovyan":
     c.ServerApp.ip = "0.0.0.0"
 
 c.ServerApp.port = 8888
+c.ServerApp.port_retries = 0
 c.ServerApp.open_browser = False
 c.LabApp.dev_mode = True
 

+ 1 - 1
galata/package.json

@@ -34,7 +34,7 @@
     "build:galata": "tsc -b",
     "build:inpage": "webpack --mode=production",
     "clean": "rimraf lib tsconfig.tsbuildinfo",
-    "start": "jupyter lab --config ./jupyter_server_config.py",
+    "start": "jupyter lab --config ./jupyter_server_test_config.py",
     "start:detached": "(jlpm run start&)",
     "test": "playwright test",
     "test:benchmark": "jlpm run test -c playwright-benchmark.config.js",