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

Devcontainer testing #524

Merged
merged 2 commits into from
Jul 16, 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
26 changes: 16 additions & 10 deletions .devcontainer/testing/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
{
"name": "Selenium Tests",
"dockerComposeFile": [
"../../compose.yaml",
"docker-compose.extend.yml"
],
"service": "testing",
"shutdownAction": "stopCompose",
"workspaceFolder": "/workspace/",
"image": "mcr.microsoft.com/vscode/devcontainers/universal",
"hostRequirements": { "cpus": 2 },
"waitFor": "onCreateCommand",
"onCreateCommand": "pipx install lektor && pip install -r test-requirements.txt && npm install",
"postAttachCommand": {
"server": "lektor server",
"css": "npm run watch"
},
"portsAttributes": {
"5000": {
"label": "Lektor Server",
"onAutoForward": "openPreview"
}
},
"forwardPorts": [4444, 5000, 7900],
"onCreateCommand": "pip install -r test-requirements.txt",
"postAttachCommand": "python -m pytest",
"remoteEnv": {
"TEST_COMMAND_EXECUTOR": "http://browser:4444/wd/hub"
"TEST_COMMAND_EXECUTOR": "http://localhost:4444/wd/hub",
"PYTEST_BASE_URL": "http://localhost:5000"
},
"customizations": {
"codespaces": {
Expand Down
9 changes: 0 additions & 9 deletions .devcontainer/testing/docker-compose.extend.yml

This file was deleted.

12 changes: 1 addition & 11 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
version: '3'
services:
browser:
image: selenium/standalone-${TEST_BROWSER:-chrome}
shm_size: '2gb'
ports:
- 4444:4444 # Selenium service
- 5900:5900 # VNC server
- 7900:7900 # VNC browser client
webapp:
build: ./
ports:
- 5000:5000 # Lektor
volumes:
- .:/app
network_mode: "host"