Skip to content

Commit

Permalink
Merge pull request #524 from PyBAQ/devcontainer-testing
Browse files Browse the repository at this point in the history
Devcontainer testing
  • Loading branch information
pyjavo authored Jul 16, 2024
2 parents f9e5753 + b88bc05 commit d28d3ce
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 30 deletions.
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"

0 comments on commit d28d3ce

Please sign in to comment.