From 915b73b04e820a948e8e47097e9e37d2be0a41da Mon Sep 17 00:00:00 2001 From: Filipe C Menezes Date: Thu, 31 Jul 2025 09:08:08 +0100 Subject: [PATCH] docs: add instructions on how to debug e2e tests --- CONTRIBUTING.md | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a1fd909f86..a966451417 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,10 +82,12 @@ If you need a new mock please update or add the `//go:generate` instruction to t #### Compilation in VSCode -Please add the following line to your settings.json file : -``` +Please add the following line to your `.vscode/settings.json` file : +```json +{ "go.buildTags": "unit,e2e", "go.testTags": "unit,e2e" +} ``` This will enable compilation for unit and end-to-end tests. @@ -95,7 +97,7 @@ This will enable compilation for unit and end-to-end tests. To debug in VSCode, you must create a debug configuration for the command with the required arguments. Run the following commands to create a new launch.json file for the debugger: -``` +```shell touch .vscode/launch.json ``` Then put the following example configuration into the file. @@ -125,6 +127,36 @@ Review and replace the command name and arguments depending on the command you w } ``` +To debug e2e tests. + +```shell +touch .vscode/settings.json +``` + +Then put the following example configuration into the file. +Review and replace the atlas settings. + +```json +{ + "go.buildTags": "unit,e2e", + "go.testTags": "unit,e2e", + "go.testEnvVars": { + "ATLAS_E2E_BINARY": "${workspaceFolder}/bin/atlas", + "UPDATE_SNAPSHOTS": "skip", + "SNAPSHOTS_DIR": "${workspaceFolder}/test/e2e/testdata/.snapshots", + "GOCOVERDIR": "${workspaceFolder}/cov", + "DO_NOT_TRACK": "1", + "E2E_SKIP_CLEANUP": "false", + "MONGODB_ATLAS_ORG_ID": "", + "MONGODB_ATLAS_PROJECT_ID": "", + "MONGODB_ATLAS_PRIVATE_API_KEY": "", + "MONGODB_ATLAS_PUBLIC_API_KEY": "", + "MONGODB_ATLAS_OPS_MANAGER_URL": "https://cloud.mongodb.com/", + "MONGODB_ATLAS_SERVICE": "cloud", + } +} +``` + ### Contributing New Command Group `Atlas CLI` uses the [Cobra Framework](https://umarcor.github.io/cobra/).