Skip to content

Commit 3d42fb3

Browse files
committed
roll back pabot
1 parent e326ed6 commit 3d42fb3

File tree

4 files changed

+39
-38
lines changed

4 files changed

+39
-38
lines changed

requirements/atest.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
bs4
44
robotframework >=4
55
robotframework-lsp
6-
robotframework-pabot
76
robotframework-seleniumlibrary
87
robotkernel

requirements/atest.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ dependencies:
99
- geckodriver
1010
- jupyterlab_robotmode
1111
- robotframework >=4
12-
- robotframework-pabot
1312
- robotframework-seleniumlibrary
1413
- robotkernel

requirements/github-actions.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ dependencies:
4040
- bs4
4141
- firefox
4242
- geckodriver
43-
- robotframework-pabot
4443
- robotframework-seleniumlibrary

scripts/atest.py

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,39 @@
11
""" Run acceptance tests with robot framework
22
"""
33
# pylint: disable=broad-except
4-
import json
5-
import multiprocessing
64
import os
75
import platform
86
import shutil
97
import sys
108
import time
9+
from os.path import join
1110
from pathlib import Path
1211

1312
import robot
14-
from pabot import pabot
15-
16-
OS = platform.system()
17-
PY = "".join(map(str, sys.version_info[:2]))
1813

1914
ROOT = Path(__file__).parent.parent.resolve()
2015
ATEST = ROOT / "atest"
2116
OUT = ATEST / "output"
2217

23-
ATEST_RETRIES = json.loads(os.environ.get("ATEST_RETRIES", "0"))
24-
ATEST_PROCESSES = json.loads(os.environ.get("ATEST_PROCESSES", "1"))
25-
26-
if not ATEST_PROCESSES:
27-
# each test incurs a jupyter server, a browser, and a bunch of language
28-
# servers and kernels, so be a bit more conservative than the default
29-
# $CPU_COUNT + 1
30-
ATEST_PROCESSES = max(int(multiprocessing.cpu_count() / 2), 1) + 1
18+
OS = platform.system()
19+
PY = "".join(map(str, sys.version_info[:2]))
3120

3221
OS_PY_ARGS = {
3322
# notebook and ipykernel releases do not yet support python 3.8 on windows
3423
# ("Windows", "38"): ["--include", "not-supported", "--runemptysuite"]
24+
# TODO: restore when we figure out win36 vs jedi on windows
25+
("Windows", "36"): ["--exclude", "feature:completion", "--runemptysuite"]
3526
}
3627

3728
NON_CRITICAL = [
3829
# TODO: restore when yaml-language-server supports both config and...
3930
# everything else: https://github.com/jupyter-lsp/jupyterlab-lsp/pull/245
4031
["language:yaml", "feature:config"],
32+
# TODO: restore when we figure out win36 vs jedi on windows
33+
["language:python", "py:36", "os:windows"],
4134
]
4235

36+
4337
# because we use diagnostics as a litmus for "working", revert to behavior
4438
# from before https://github.com/bash-lsp/bash-language-server/pull/269
4539
os.environ["HIGHLIGHT_PARSING_ERRORS"] = "true"
@@ -57,6 +51,24 @@ def get_stem(attempt, extra_args):
5751
def atest(attempt, extra_args):
5852
"""perform a single attempt of the acceptance tests"""
5953

54+
# TODO: investigate whether this is still required vs geckodriver 0.28
55+
if "FIREFOX_BINARY" not in os.environ:
56+
os.environ["FIREFOX_BINARY"] = shutil.which("firefox")
57+
58+
prefix = os.environ.get("CONDA_PREFIX")
59+
60+
if prefix:
61+
app_dir = join(prefix, "bin", "FirefoxApp")
62+
os.environ["FIREFOX_BINARY"] = {
63+
"Windows": join(prefix, "Library", "bin", "firefox.exe"),
64+
"Linux": join(app_dir, "firefox"),
65+
"Darwin": join(app_dir, "Contents", "MacOS", "firefox"),
66+
}[OS]
67+
68+
print("Will use firefox at", os.environ["FIREFOX_BINARY"])
69+
70+
assert os.path.exists(os.environ["FIREFOX_BINARY"])
71+
6072
extra_args += OS_PY_ARGS.get((OS, PY), [])
6173

6274
stem = get_stem(attempt, extra_args)
@@ -65,7 +77,7 @@ def atest(attempt, extra_args):
6577
extra_args += ["--skiponfailure", "AND".join(non_critical)]
6678

6779
if attempt != 1:
68-
previous = OUT / get_stem(attempt - 1, extra_args) / "output.xml"
80+
previous = OUT / f"{get_stem(attempt - 1, extra_args)}.robot.xml"
6981
if previous.exists():
7082
extra_args += ["--rerunfailed", str(previous)]
7183

@@ -76,14 +88,18 @@ def atest(attempt, extra_args):
7688
f"{OS}{PY}",
7789
"--outputdir",
7890
out_dir,
91+
"--output",
92+
OUT / f"{stem}.robot.xml",
93+
"--log",
94+
OUT / f"{stem}.log.html",
95+
"--report",
96+
OUT / f"{stem}.report.html",
97+
"--xunit",
98+
OUT / f"{stem}.xunit.xml",
7999
"--variable",
80100
f"OS:{OS}",
81101
"--variable",
82102
f"PY:{PY}",
83-
# don't ever test our examples
84-
"--exclude",
85-
"atest:example",
86-
# random ensures there's not inter-test coupling
87103
"--randomize",
88104
"all",
89105
*(extra_args or []),
@@ -92,29 +108,17 @@ def atest(attempt, extra_args):
92108

93109
print("Robot Arguments\n", " ".join(["robot"] + list(map(str, args))))
94110

111+
os.chdir(ATEST)
112+
95113
if out_dir.exists():
96114
print("trying to clean out {}".format(out_dir))
97115
try:
98116
shutil.rmtree(out_dir)
99117
except Exception as err:
100118
print("Error deleting {}, hopefully harmless: {}".format(out_dir, err))
101119

102-
os.chdir(ATEST)
103-
104-
str_args = list(map(str, args))
105-
106120
try:
107-
if "--dryrun" in extra_args or ATEST_PROCESSES == 1:
108-
robot.run_cli(str_args)
109-
else:
110-
pabot.main(
111-
[
112-
*("--processes", f"{ATEST_PROCESSES}"),
113-
*("--artifacts", "png,log"),
114-
"--artifactsinsubfolders",
115-
*str_args,
116-
]
117-
)
121+
robot.run_cli(list(map(str, args)))
118122
return 0
119123
except SystemExit as err:
120124
return err.code
@@ -125,7 +129,7 @@ def attempt_atest_with_retries(*extra_args):
125129
attempt = 0
126130
error_count = -1
127131

128-
retries = ATEST_RETRIES
132+
retries = int(os.environ.get("ATEST_RETRIES") or "0")
129133

130134
while error_count != 0 and attempt <= retries:
131135
attempt += 1

0 commit comments

Comments
 (0)