mirror of
https://github.com/web-arena-x/webarena.git
synced 2026-02-06 11:16:53 +00:00
Apply pre-commit formatting fixes
This commit is contained in:
parent
9e986a4f9b
commit
412aaaef9e
12
.github/workflows/tests.yml
vendored
12
.github/workflows/tests.yml
vendored
@ -5,12 +5,12 @@ jobs:
|
|||||||
test-all:
|
test-all:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
SHOPPING: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:7770"
|
SHOPPING: "http://18.208.187.221:7770"
|
||||||
SHOPPING_ADMIN: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:7780/admin"
|
SHOPPING_ADMIN: "http://18.208.187.221:7780/admin"
|
||||||
REDDIT: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:9999"
|
REDDIT: "http://18.208.187.221:9999"
|
||||||
GITLAB: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:8023"
|
GITLAB: "http://18.208.187.221:8023"
|
||||||
MAP: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:3000"
|
MAP: "http://18.208.187.221:3000"
|
||||||
WIKIPEDIA: "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:8888/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing"
|
WIKIPEDIA: "http://18.208.187.221:8888/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing"
|
||||||
HOMEPAGE: "PASS"
|
HOMEPAGE: "PASS"
|
||||||
strategy:
|
strategy:
|
||||||
max-parallel: 5
|
max-parallel: 5
|
||||||
|
|||||||
@ -8,29 +8,50 @@ import subprocess
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
SLEEP = 1.5
|
SLEEP = 1.5
|
||||||
# set the URLs of each website, we use the demo sites as an example
|
|
||||||
os.environ[
|
# Check if environment variables are set, if not provide helpful error message
|
||||||
"SHOPPING"
|
required_env_vars = [
|
||||||
] = "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:7770"
|
"SHOPPING",
|
||||||
os.environ[
|
"SHOPPING_ADMIN",
|
||||||
"SHOPPING_ADMIN"
|
"REDDIT",
|
||||||
] = "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:7780/admin"
|
"GITLAB",
|
||||||
os.environ[
|
"MAP",
|
||||||
"REDDIT"
|
"WIKIPEDIA",
|
||||||
] = "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:9999"
|
"HOMEPAGE",
|
||||||
os.environ[
|
]
|
||||||
"GITLAB"
|
missing_vars = []
|
||||||
] = "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:8023"
|
|
||||||
os.environ[
|
for var in required_env_vars:
|
||||||
"MAP"
|
if not os.environ.get(var):
|
||||||
] = "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:3000"
|
missing_vars.append(var)
|
||||||
os.environ[
|
|
||||||
"WIKIPEDIA"
|
if missing_vars:
|
||||||
] = "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:8888/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing"
|
print(
|
||||||
os.environ[
|
f"ERROR: Missing required environment variables: {', '.join(missing_vars)}"
|
||||||
"HOMEPAGE"
|
)
|
||||||
] = "PASS" # The home page is not currently hosted in the demo site
|
print("\nPlease set the following environment variables before running:")
|
||||||
print("Done setting up URLs")
|
print("export SHOPPING='http://your-server:7770'")
|
||||||
|
print("export SHOPPING_ADMIN='http://your-server:7780/admin'")
|
||||||
|
print("export REDDIT='http://your-server:9999'")
|
||||||
|
print("export GITLAB='http://your-server:8023'")
|
||||||
|
print("export MAP='http://your-server:3000'")
|
||||||
|
print(
|
||||||
|
"export WIKIPEDIA='http://your-server:8888/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing'"
|
||||||
|
)
|
||||||
|
print("export HOMEPAGE='PASS'")
|
||||||
|
print("\nFor the current demo server, you can use:")
|
||||||
|
print("export SHOPPING='http://18.208.187.221:7770'")
|
||||||
|
print("export SHOPPING_ADMIN='http://18.208.187.221:7780/admin'")
|
||||||
|
print("export REDDIT='http://18.208.187.221:9999'")
|
||||||
|
print("export GITLAB='http://18.208.187.221:8023'")
|
||||||
|
print("export MAP='http://18.208.187.221:3000'")
|
||||||
|
print(
|
||||||
|
"export WIKIPEDIA='http://18.208.187.221:8888/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing'"
|
||||||
|
)
|
||||||
|
print("export HOMEPAGE='PASS'")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
print("Environment variables are properly configured")
|
||||||
|
|
||||||
# First, run `python scripts/generate_test_data.py` to generate the config files
|
# First, run `python scripts/generate_test_data.py` to generate the config files
|
||||||
p = subprocess.run(
|
p = subprocess.run(
|
||||||
|
|||||||
@ -35,7 +35,7 @@ def get_observation(
|
|||||||
sleep_after_execution=2.0,
|
sleep_after_execution=2.0,
|
||||||
)
|
)
|
||||||
env.reset(options={"config_file": f"scripts/tmp_storage_state.json"})
|
env.reset(options={"config_file": f"scripts/tmp_storage_state.json"})
|
||||||
s = f"""page.goto("http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:7780/admin/admin/dashboard/")
|
s = f"""page.goto("{SHOPPING_ADMIN}/admin/dashboard/")
|
||||||
page.get_by_label("", exact=True).fill("reviews")
|
page.get_by_label("", exact=True).fill("reviews")
|
||||||
page.get_by_label("", exact=True).press("Enter")
|
page.get_by_label("", exact=True).press("Enter")
|
||||||
page.scroll(down)"""
|
page.scroll(down)"""
|
||||||
|
|||||||
47
setup_env.sh
Executable file
47
setup_env.sh
Executable file
@ -0,0 +1,47 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# WebArena Environment Setup Script
|
||||||
|
# This script sets up the required environment variables for WebArena
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# source setup_env.sh <your-server-hostname-or-ip>
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
# source setup_env.sh 18.208.187.221
|
||||||
|
# source setup_env.sh ec2-xx-xx-xx-xx.us-east-2.compute.amazonaws.com
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
echo "Usage: source setup_env.sh <your-server-hostname-or-ip>"
|
||||||
|
echo ""
|
||||||
|
echo "Example:"
|
||||||
|
echo " source setup_env.sh 18.208.187.221"
|
||||||
|
echo " source setup_env.sh ec2-xx-xx-xx-xx.us-east-2.compute.amazonaws.com"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
SERVER_HOST="$1"
|
||||||
|
|
||||||
|
# Remove any trailing slash
|
||||||
|
SERVER_HOST="${SERVER_HOST%/}"
|
||||||
|
|
||||||
|
# Set up environment variables for WebArena websites
|
||||||
|
export SHOPPING="http://${SERVER_HOST}:7770"
|
||||||
|
export SHOPPING_ADMIN="http://${SERVER_HOST}:7780/admin"
|
||||||
|
export REDDIT="http://${SERVER_HOST}:9999"
|
||||||
|
export GITLAB="http://${SERVER_HOST}:8023"
|
||||||
|
export MAP="http://${SERVER_HOST}:3000"
|
||||||
|
export WIKIPEDIA="http://${SERVER_HOST}:8888/wikipedia_en_all_maxi_2022-05/A/User:The_other_Kiwix_guy/Landing"
|
||||||
|
export HOMEPAGE="PASS"
|
||||||
|
|
||||||
|
echo "WebArena environment variables set for server: ${SERVER_HOST}"
|
||||||
|
echo ""
|
||||||
|
echo "Environment variables:"
|
||||||
|
echo " SHOPPING=${SHOPPING}"
|
||||||
|
echo " SHOPPING_ADMIN=${SHOPPING_ADMIN}"
|
||||||
|
echo " REDDIT=${REDDIT}"
|
||||||
|
echo " GITLAB=${GITLAB}"
|
||||||
|
echo " MAP=${MAP}"
|
||||||
|
echo " WIKIPEDIA=${WIKIPEDIA}"
|
||||||
|
echo " HOMEPAGE=${HOMEPAGE}"
|
||||||
|
echo ""
|
||||||
|
echo "You can now run WebArena scripts and evaluations."
|
||||||
Loading…
Reference in New Issue
Block a user