From d0f6dbb87d455620cfcdd5872e1d8582c35adf76 Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Sun, 28 Feb 2021 15:23:00 +0000 Subject: [PATCH] Fully automate dev setup with Gitpod This commit implements a fully-automated development setup using Gitpod.io, an online IDE for GitLab, GitHub, and Bitbucket that enables Dev-Environments-As-Code. This makes it easy for anyone to get a ready-to-code workspace for any branch, issue or pull request almost instantly with a single click. Includes vscode gitpod config for debugging and testing. --- .gitpod.yml | 34 ++++++++++++++++++++++++++++++++++ .vscode/.test.env | 1 + .vscode/launch_gitpod.json | 32 ++++++++++++++++++++++++++++++++ .vscode/settings_gitpod.json | 13 +++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 .gitpod.yml create mode 100644 .vscode/.test.env create mode 100644 .vscode/launch_gitpod.json create mode 100644 .vscode/settings_gitpod.json diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000000..828c188acf39 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,34 @@ +github: + prebuilds: + # enable for the master/default branch (defaults to true) + master: true + # enable for all branches in this repo (defaults to false) + branches: true + # enable for pull requests coming from this repo (defaults to true) + pullRequests: true + # enable for pull requests coming from forks (defaults to false) + pullRequestsFromForks: true + # add a "Review in Gitpod" button as a comment to pull requests (defaults to true) + addComment: false + # add a "Review in Gitpod" button to pull requests (defaults to false) + addBadge: false + # add a label once the prebuild is ready to pull requests (defaults to false) + addLabel: false +image: gitpod/workspace-postgres +tasks: + - init: > + cp .vscode/settings_gitpod.json .vscode/settings.json && + cp .vscode/launch_gitpod.json .vscode/launch.json && + pip install psycopg2 && + pip install -r lib/galaxy/dependencies/dev-requirements.txt && + createdb galaxy && + make client + - command: cp config/galaxy.yml.sample config/galaxy.yml + - command: make client-watch +# Ports to expose on workspace startup (optional) +ports: + - port: 8000 +vscode: + extensions: + - ms-python.python + - ms-python.vscode-pylance diff --git a/.vscode/.test.env b/.vscode/.test.env new file mode 100644 index 000000000000..0fd4d77f2ed0 --- /dev/null +++ b/.vscode/.test.env @@ -0,0 +1 @@ +GALAXY_TEST_TOOL_CONF="lib/galaxy/config/sample/tool_conf.xml.sample,test/functional/tools/samples_tool_conf.xml" \ No newline at end of file diff --git a/.vscode/launch_gitpod.json b/.vscode/launch_gitpod.json new file mode 100644 index 000000000000..04a17726d1f3 --- /dev/null +++ b/.vscode/launch_gitpod.json @@ -0,0 +1,32 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "GalaxyFastAPI uvicorn", + "type": "python", + "request": "launch", + "module": "uvicorn", + "args": ["--app-dir", "lib", "--factory", "galaxy.webapps.galaxy.fast_factory:factory"], + "env": { + "GALAXY_CONFIG_FILE": "${workspaceFolder}/config/galaxy.yml", + "GALAXY_CONDA_AUTO_INIT": "false", + "GALAXY_CONFIG_TOOL_CONFIG_FILE": "lib/galaxy/config/sample/tool_conf.xml.sample,test/functional/tools/samples_tool_conf.xml", + "GALAXY_CONFIG_DATABASE_CONNECTION": "postgresql://localhost/galaxy" + } + }, + { + "name": "Tool test framework", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/.venv/bin/pytest", + "args": [ + "test/functional/test_toolbox_pytest.py", + "-m", + "tool", + "-k", + "job_properties_test_2" + ] + } + ] +} + diff --git a/.vscode/settings_gitpod.json b/.vscode/settings_gitpod.json new file mode 100644 index 000000000000..c08dce96ca1a --- /dev/null +++ b/.vscode/settings_gitpod.json @@ -0,0 +1,13 @@ +{ + "python.testing.pytestArgs": [ + "--doctest-modules", + "lib/galaxy_test/api/", + "lib/galaxy/datatypes", + "test/unit", + "test/integration", + "lib/galaxy_test/selenium/" + ], + "python.testing.pytestEnabled": true, + "python.envFile": "${workspaceFolder}/.vscode/.test.env" +} +