Skip to content

Commit

Permalink
Add Open WebUI test scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
EtiennePerot committed Sep 30, 2024
1 parent 2c99cc8 commit 1ee32f7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ To mitigate these problems, this repository is organized as follows:
├── 🏗️ build
│ │ # Script to generate the contents of `🚢 /open-webui`:
│ └── 🐍 build_openwebui.py
├── 🧪 tests
│ └── 📂 open-webui
│ ├── 📂 functions
│ │ │ # Execute self-tests for open-webui/functions/run_code.py:
│ │ └── 📜 run_code_tests.sh
│ └── 📂 tools
│ │ # Execute self-tests for open-webui/tools/run_code.py:
│ └── 📜 run_code_tests.sh
└── ❓ docs
│ # This document:
└── 📃 dev.md
Expand Down
15 changes: 15 additions & 0 deletions tests/openwebui/functions/run_code_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -euo pipefail

REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"

docker run --rm \
--security-opt=seccomp=unconfined \
--security-opt=apparmor=unconfined \
--security-opt=label=type:container_engine_t \
--mount=type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup,readonly=false \
--mount=type=bind,source=/proc,target=/proc2,readonly=false,bind-recursive=disabled \
--mount=type=bind,source="$REPO_DIR",target=/test \
ghcr.io/open-webui/open-webui:main \
python3 /test/open-webui/functions/run_code.py --self_test
15 changes: 15 additions & 0 deletions tests/openwebui/tools/run_code_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -euo pipefail

REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"

docker run --rm \
--security-opt=seccomp=unconfined \
--security-opt=apparmor=unconfined \
--security-opt=label=type:container_engine_t \
--mount=type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup,readonly=false \
--mount=type=bind,source=/proc,target=/proc2,readonly=false,bind-recursive=disabled \
--mount=type=bind,source="$REPO_DIR",target=/test \
ghcr.io/open-webui/open-webui:main \
python3 /test/open-webui/tools/run_code.py --self_test

0 comments on commit 1ee32f7

Please sign in to comment.