generated from jupyterlab-contrib/jupyterlab-app-cookiecutter
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix packaging the frontend And test for isolated installation * Update gitignore * Fix workflow syntax * Ignore log error for now * Fix base-setup * Lint the code * Prettify * Fix conda pkg installation * Fix shell * Fix availability of quetz-frontend packages * Fix core path for building extension * Create server config in well specified folder * Use existing file for hash construction
- Loading branch information
1 parent
fd2a1c1
commit abd1fe6
Showing
16 changed files
with
1,115 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,4 @@ junit.xml | |
*.code-workspace | ||
.history | ||
.vscode | ||
examples/tests/test_quetz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { ConsoleMessage, expect, test } from '@playwright/test'; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await Promise.all([ | ||
page.waitForNavigation({ | ||
url: (url) => url.pathname === '/', | ||
}), | ||
page.goto('/api/dummylogin/alice'), | ||
]); | ||
}); | ||
|
||
test('should load the example', async ({ baseURL, page }) => { | ||
const URL = process.env['BASE_URL'] ?? baseURL; | ||
console.info('Navigating to page:', URL); | ||
|
||
let errorLogs = 0; | ||
let testEnded: (value: string | PromiseLike<string>) => void; | ||
const waitForTestEnd = new Promise<string>((resolve) => { | ||
testEnded = resolve; | ||
}); | ||
|
||
const handleMessage = async (msg: ConsoleMessage) => { | ||
const text = msg.text(); | ||
console.log(msg.type(), '>>', text); | ||
if (msg.type() === 'error') { | ||
errorLogs += 1; | ||
} | ||
|
||
const lower = text.toLowerCase(); | ||
// An extension example must emit a console log message ending by `is activated!` | ||
if (/is activated!$/.test(lower)) { | ||
testEnded(text); | ||
} | ||
}; | ||
|
||
page.on('console', handleMessage); | ||
|
||
await page.goto(URL); | ||
|
||
await expect(page.locator('#jupyter-config-data')).toBeDefined(); | ||
|
||
await waitForTestEnd; | ||
|
||
// FIXME some errors are occurring | ||
// await expect(errorLogs).toEqual(0); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "@quetz-frontend/examples-test", | ||
"version": "1.0.0", | ||
"description": "Quetz Frontend Examples Tests", | ||
"private": true, | ||
"scripts": { | ||
"start": "quetz start /tmp/test_quetz", | ||
"test": "yarn playwright test" | ||
}, | ||
"devDependencies": { | ||
"@playwright/test": "^1.19.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { PlaywrightTestConfig, devices } from '@playwright/test'; | ||
|
||
const config: PlaywrightTestConfig = { | ||
forbidOnly: !!process.env.CI, | ||
retries: 0, | ||
webServer: { | ||
command: 'yarn run start', | ||
port: 8000, | ||
timeout: 120 * 1000, | ||
// It is safe to reuse the server for stories testing | ||
reuseExistingServer: true, | ||
}, | ||
use: { | ||
baseURL: process.env.TARGET_URL ?? 'http://localhost:8000', | ||
trace: 'on-first-retry', | ||
}, | ||
projects: [ | ||
{ | ||
name: 'chromium', | ||
use: { ...devices['Desktop Chrome'] }, | ||
}, | ||
// { | ||
// name: 'firefox', | ||
// use: { ...devices['Desktop Firefox'] } | ||
// }, | ||
// { | ||
// name: 'webkit', | ||
// use: { ...devices['Desktop Safari'] } | ||
// } | ||
], | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const TerserPlugin = require('terser-webpack-plugin'); | ||
const merge = require('webpack-merge').default; | ||
const WPPlugin = require('@quetz-frontend/builder').WPPlugin; | ||
const config = require('./webpack.config'); | ||
|
||
config[0] = merge(config[0], { | ||
mode: 'production', | ||
devtool: false, // 'source-map', | ||
output: { | ||
// Add version argument when in production so the Jupyter server | ||
// allows caching of files (i.e., does not set the CacheControl header to no-cache to prevent caching static files) | ||
filename: '[name].[contenthash].js?v=[contenthash]', | ||
}, | ||
optimization: { | ||
minimize: true, | ||
minimizer: [ | ||
new TerserPlugin({ | ||
parallel: true, | ||
sourceMap: true, | ||
terserOptions: { | ||
compress: false, | ||
ecma: 6, | ||
mangle: true, | ||
output: { | ||
beautify: false, | ||
comments: false, | ||
}, | ||
safari10: true, | ||
}, | ||
cache: process.platform !== 'win32', | ||
}), | ||
], | ||
}, | ||
plugins: [ | ||
new WPPlugin.JSONLicenseWebpackPlugin({ | ||
excludedPackageTest: (packageName) => | ||
packageName === '@quetz-frontend/main-app', | ||
}), | ||
], | ||
}); | ||
|
||
module.exports = config; |
Oops, something went wrong.