Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed github tokens being broken #326

Merged
merged 2 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions public/pyworker/runRobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from importlib import import_module, reload
from io import StringIO
from pathlib import Path

def log(message):
js.postMessage(json.dumps({"std_output": message}))

Expand All @@ -20,18 +20,21 @@ def log(message):
try:
import robot
from robot.libdocpkg import LibraryDocumentation
from robot.conf import RobotSettings
except ImportError:
robot = None

if robot is None:
log(f"Install Robot Framework")
rf_version = f"=={version}" if version else ""
requirements_list.insert(0, f"robotframework{rf_version}")
if not [req for req in requirements_list if req.split('==')[0] == 'robotframework']:
rf_version = f"=={version}" if version else ""
requirements_list.insert(0, f"robotframework{rf_version}")
try:
await micropip.install(requirements_list, keep_going=True)
time.sleep(1)
import robot
from robot.libdocpkg import LibraryDocumentation
from robot.conf import RobotSettings
log(f" = version {robot.__version__}\n")
except Exception as e:
js.console.log(f"Installation Exception: {e}")
Expand Down Expand Up @@ -111,6 +114,8 @@ def write_file(file):
js.console.log(f"Files in working dir: {os.listdir('.')}")
result = -2

console_links_enabled = "ConsoleLinks" in RobotSettings._cli_opts

try:
if test_case_name:
kwargs = {"test": test_case_name}
Expand All @@ -122,9 +127,13 @@ def write_file(file):
if robot_arguments:
log(f"Robot Run Arguments: {robot_args}\n")
log(f"\nRunning Robot Framework:\n")
if console_links_enabled:
robot_arguments["consolelinks"] = 'off'
else:
log(f"> robot --loglevel TRACE:INFO --exclude EXCL --skip SKIP\n"
f" --removekeywords tag:REMOVE --flattenkeywords tag:FLAT{testcli} .\n")
if console_links_enabled:
kwargs["consolelinks"] = 'off'

org_stdout = sys.__stdout__
org_stderr = sys.__stderr__
Expand Down
6 changes: 4 additions & 2 deletions src/js/code/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const getProjectFromLiveDir = async(projectDir) => {

const getProject = async(projectUrl) => {
console.log(`Loading data from ${projectUrl}`)
const configFile = await fetch(`${projectUrl}/config.json?token=${Date.now()}`)
// const configFile = await fetch(`${projectUrl}/config.json?token=${Date.now()}`)
const configFile = await fetch(`${projectUrl}/config.json`)
.then(response => response.json())
const project = { name: configFile.name, files: [], description: '' }
if (configFile.robotVersion) {
Expand All @@ -48,7 +49,8 @@ const getProject = async(projectUrl) => {
}
for (const file of configFile.files) {
const { fileName, hidden } = file
const content = await fetch(`${projectUrl}/${fileName}?token=${Date.now()}`)
// const content = await fetch(`${projectUrl}/${fileName}?token=${Date.now()}`)
const content = await fetch(`${projectUrl}/${fileName}`)
.then(response => response.text())
project.files.push({
fileName,
Expand Down
Loading