From 232475454879c95badfdd8c5e6280e107d7f0af5 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 8 May 2018 16:08:07 -0700 Subject: [PATCH] Fix flask app variable in debug configuration and flask unit tests (#1641) * Fix flask app variable and tests --- news/2 Fixes/1634.md | 1 + news/3 Code Health/1640.md | 1 + package.json | 8 ++++---- src/test/debugger/web.framework.test.ts | 9 +++------ 4 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 news/2 Fixes/1634.md create mode 100644 news/3 Code Health/1640.md diff --git a/news/2 Fixes/1634.md b/news/2 Fixes/1634.md new file mode 100644 index 000000000000..b9c8cbefe658 --- /dev/null +++ b/news/2 Fixes/1634.md @@ -0,0 +1 @@ +Modify the `FLASK_APP` environment variable in the flask debug configuration to include just the name of the application file. diff --git a/news/3 Code Health/1640.md b/news/3 Code Health/1640.md new file mode 100644 index 000000000000..329147d17bf9 --- /dev/null +++ b/news/3 Code Health/1640.md @@ -0,0 +1 @@ +Fix unit tests used to test flask template debugging on AppVeyor for the experimental debugger. diff --git a/package.json b/package.json index 3a8ffd2d11e1..aa2a85f44083 100644 --- a/package.json +++ b/package.json @@ -392,7 +392,7 @@ "module": "flask", "cwd": "^\"\\${workspaceFolder}\"", "env": { - "FLASK_APP": "^\"\\${workspaceFolder}/app.py\"" + "FLASK_APP": "app.py" }, "args": [ "run", @@ -685,7 +685,7 @@ "request": "launch", "module": "flask", "env": { - "FLASK_APP": "${workspaceFolder}/app.py" + "FLASK_APP": "app.py" }, "args": [ "run", @@ -808,7 +808,7 @@ "request": "launch", "module": "flask", "env": { - "FLASK_APP": "^\"\\${workspaceFolder}/app.py\"" + "FLASK_APP": "app.py" }, "args": [ "run", @@ -1107,7 +1107,7 @@ "request": "launch", "module": "flask", "env": { - "FLASK_APP": "${workspaceFolder}/app.py" + "FLASK_APP": "app.py" }, "args": [ "run", diff --git a/src/test/debugger/web.framework.test.ts b/src/test/debugger/web.framework.test.ts index f95dbedaca77..bb3be26a80b6 100644 --- a/src/test/debugger/web.framework.test.ts +++ b/src/test/debugger/web.framework.test.ts @@ -13,7 +13,7 @@ import { EXTENSION_ROOT_DIR } from '../../client/common/constants'; import { noop } from '../../client/common/core.utils'; import { DebugOptions, LaunchRequestArguments } from '../../client/debugger/Common/Contracts'; import { PYTHON_PATH, sleep } from '../common'; -import { IS_APPVEYOR, IS_MULTI_ROOT_TEST, TEST_DEBUGGER } from '../initialize'; +import { IS_MULTI_ROOT_TEST, TEST_DEBUGGER } from '../initialize'; import { DEBUGGER_TIMEOUT } from './common/constants'; import { continueDebugging, createDebugAdapter, ExpectedVariable, hitHttpBreakpoint, makeHttpRequest, validateVariablesInFrame } from './utils'; @@ -62,7 +62,7 @@ suite(`Django and Flask Debugging: ${debuggerType}`, () => { const port = await getFreePort({ host: 'localhost' }); const options = buildLaunchArgs(workspaceDirectory); - options.env!['FLASK_APP'] = path.join(workspaceDirectory, 'run.py'); + options.env!['FLASK_APP'] = 'run.py'; options.module = 'flask'; options.debugOptions = [DebugOptions.RedirectOutput, DebugOptions.Jinja]; options.args = [ @@ -129,10 +129,7 @@ suite(`Django and Flask Debugging: ${debuggerType}`, () => { expect(htmlResult).to.contain('Hello this_is_another_value_from_server'); } - test('Test Flask Route and Template debugging', async function () { - if (IS_APPVEYOR) { - return this.skip(); - } + test('Test Flask Route and Template debugging', async () => { const workspaceDirectory = path.join(EXTENSION_ROOT_DIR, 'src', 'testMultiRootWkspc', 'workspace5', 'flaskApp'); const { options, port } = await buildFlaskLaunchArgs(workspaceDirectory);