Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Nov 6, 2023
1 parent c0ac05f commit 4e1617f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
run: |
python -m pytest -v --ignore=tests/benchmarks -m "jstest" tests
check:
check:

# This job does nothing and is only used for the branch protection
# see https://github.com/marketplace/actions/alls-green#why
Expand Down
62 changes: 31 additions & 31 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import shutil
import socket
import string
import subprocess
import sys
import tempfile
from pathlib import Path
from typing import Any, Dict
Expand Down Expand Up @@ -143,37 +145,35 @@ def test_js(self) -> Dict[str, Any]:
cypress_config = json.dumps(js_test_config)
cypress_config_file = get_abspath("js_test/cypress.config.js")

try:
import subprocess

# Run the Cypress test command
completed_process = subprocess.run(
[
"npx",
"cypress",
"run",
# "--browser",
# "chrome",
"--config-file",
rf"{cypress_config_file}",
"--config",
rf"{cypress_config}",
],
capture_output=True,
)

# Send back return code, stdout, and stderr
return {
"returncode": completed_process.returncode,
"stdout": completed_process.stdout,
"stderr": completed_process.stderr,
}
except (Exception, subprocess.CalledProcessError) as e:
return {
"returncode": 1,
"stdout": "",
"stderr": e,
}
# Run the Cypress test command
completed_process = subprocess.run(
[
"npx",
"cypress",
"run",
# "--browser",
# "chrome",
"--config-file",
rf"{cypress_config_file}",
"--config",
rf"{cypress_config}",
],
capture_output=True,
)

# Send back return code, stdout, and stderr
stdout = completed_process.stdout.decode("utf-8")
stderr = completed_process.stderr.decode("utf-8")

if completed_process.returncode != 0:
print(stdout)
print(stderr, file=sys.stderr)

return {
"returncode": completed_process.returncode,
"stdout": stdout,
"stderr": stderr,
}


@pytest.fixture(scope="session")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sn_collapse_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_collapse_button_in_variant_doc(test_app, test_server):

# Check the return code and stdout
assert js_test_result["returncode"] == 0
assert "All specs passed!" in js_test_result["stdout"].decode("utf-8")
assert "All specs passed!" in js_test_result["stdout"]


@pytest.mark.jstest
Expand All @@ -49,4 +49,4 @@ def test_collapse_button_in_doc_basic(test_app, test_server):

# Check the return code and stdout
assert js_test_result["returncode"] == 0
assert "All specs passed!" in js_test_result["stdout"].decode("utf-8")
assert "All specs passed!" in js_test_result["stdout"]

0 comments on commit 4e1617f

Please sign in to comment.