diff --git a/.devcontainer/testing/devcontainer.json b/.devcontainer/testing/devcontainer.json index 3f0f2139..6daa16b0 100644 --- a/.devcontainer/testing/devcontainer.json +++ b/.devcontainer/testing/devcontainer.json @@ -1,17 +1,22 @@ { "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" }, "customizations": { "codespaces": { diff --git a/.devcontainer/testing/docker-compose.extend.yml b/.devcontainer/testing/docker-compose.extend.yml deleted file mode 100644 index 7805b587..00000000 --- a/.devcontainer/testing/docker-compose.extend.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: '3' -services: - testing: - image: mcr.microsoft.com/vscode/devcontainers/python:3.11 - volumes: - # Mounts the project folder to '/workspace'. While this file is in .devcontainer, - # mounts are relative to the first file in the list, which is a level up. - - .:/workspace:cached - command: /bin/sh -c "while sleep 1000; do :; done" diff --git a/compose.yaml b/compose.yaml index 6c47c3da..e071364c 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,4 +1,3 @@ -version: '3' services: browser: image: selenium/standalone-${TEST_BROWSER:-chrome} @@ -7,9 +6,4 @@ services: - 4444:4444 # Selenium service - 5900:5900 # VNC server - 7900:7900 # VNC browser client - webapp: - build: ./ - ports: - - 5000:5000 # Lektor - volumes: - - .:/app + network_mode: "host"