mirror of
https://github.com/pyscript/pyscript.git
synced 2026-03-24 11:00:38 -04:00
Fix and enable integration tests in CI (#721)
* run jest only inside node + fix indexURL for integration tests * add integration tests to CI * use pytest from env
This commit is contained in:
3
.github/workflows/build-unstable.yml
vendored
3
.github/workflows/build-unstable.yml
vendored
@@ -62,6 +62,9 @@ jobs:
|
||||
- name: Build and Test
|
||||
run: make test
|
||||
|
||||
- name: Integration Tests
|
||||
run: make test-integration
|
||||
|
||||
# Deploy to S3
|
||||
- name: Configure AWS credentials
|
||||
if: github.ref == 'refs/heads/main' # Only deploy on merge into main
|
||||
|
||||
@@ -78,9 +78,9 @@ test:
|
||||
make test-ts
|
||||
make test-py
|
||||
|
||||
test-local:
|
||||
test-integration:
|
||||
make examples
|
||||
pytest -vvs $(ARGS) tests/integration/ --log-cli-level=warning
|
||||
$(PYTEST_EXE) -vvs $(ARGS) tests/integration/ --log-cli-level=warning
|
||||
|
||||
test-py:
|
||||
@echo "Tests from $(src_dir)"
|
||||
|
||||
@@ -15,17 +15,15 @@ export class PyodideRuntime extends Runtime {
|
||||
|
||||
async loadInterpreter(): Promise<void> {
|
||||
console.log('creating pyodide runtime');
|
||||
// eslint-disable-next-line
|
||||
// @ts-ignore
|
||||
let extraOpts: any = {}
|
||||
if (inJest()) {
|
||||
extraOpts = {indexURL: [process.cwd(), 'node_modules', 'pyodide'].join('/') }
|
||||
}
|
||||
let indexURL: string = this.src.substring(0, this.src.length - "/pyodide.js".length)
|
||||
if (typeof process === 'object' && inJest()) {
|
||||
indexURL = [process.cwd(), 'node_modules', 'pyodide'].join('/')
|
||||
}
|
||||
this.interpreter = await loadPyodide({
|
||||
stdout: console.log,
|
||||
stderr: console.log,
|
||||
fullStdLib: false,
|
||||
...extraOpts
|
||||
indexURL
|
||||
});
|
||||
|
||||
this.globals = this.interpreter.globals;
|
||||
|
||||
Reference in New Issue
Block a user