-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented new Python Django devfile test
Signed-off-by: Tibor Dancs <tdancs@redhat.com>
- Loading branch information
Showing
8 changed files
with
79 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--timeout 2200000 | ||
--reporter 'dist/driver/CheReporter.js' | ||
-u tdd | ||
--bail | ||
--full-trace | ||
--spec dist/tests/login/Login.spec.js | ||
--spec dist/tests/devfiles/PythonDjango.spec.js | ||
--require source-map-support/register |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2019 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
**********************************************************************/ | ||
import { NameGenerator } from '../../utils/NameGenerator'; | ||
import { error } from 'selenium-webdriver'; | ||
import 'reflect-metadata'; | ||
import * as codeExecutionHelper from '../../testsLibrary/CodeExecutionTests'; | ||
import * as workspaceHandler from '../../testsLibrary/WorksapceHandlingTests'; | ||
import * as projectManager from '../../testsLibrary/ProjectAndFileTests'; | ||
import { Logger } from '../../utils/Logger'; | ||
|
||
const workspaceName: string = NameGenerator.generate('wksp-test-', 5); | ||
const workspaceStack: string = 'Python Django'; | ||
const workspaceSampleName: string = 'django-realworld-example-app'; | ||
const workspaceRootFolderName: string = 'conduit'; | ||
|
||
const taskInstallDependencies: string = 'install dependencies'; | ||
const taskMigrate: string = 'migrate'; | ||
const taskRunServer: string = 'run server'; | ||
const taskExpectedDialogText: string = 'A process is now listening on port 7000'; | ||
|
||
suite(`${workspaceStack} test`, async () => { | ||
|
||
suite(`Create ${workspaceStack} workspace ${workspaceName}`, async () => { | ||
workspaceHandler.createAndOpenWorkspace(workspaceName, workspaceStack); | ||
projectManager.waitWorkspaceReadiness(workspaceName, workspaceSampleName, workspaceRootFolderName); | ||
}); | ||
|
||
suite('Install dependencies', async () => { | ||
codeExecutionHelper.runTask(taskInstallDependencies, 60_000); | ||
codeExecutionHelper.closeTerminal(taskInstallDependencies); | ||
}); | ||
|
||
suite('Migrate Django application project', async () => { | ||
codeExecutionHelper.runTask(taskMigrate, 30_000); | ||
codeExecutionHelper.closeTerminal(taskMigrate); | ||
}); | ||
|
||
suite('Run django server', async () => { | ||
//todo: fix try catch block. exception is not being caught for some reason | ||
try { | ||
codeExecutionHelper.runTaskWithDialogShellAndOpenLink(taskRunServer, taskExpectedDialogText, 30_000); | ||
} catch (err) { | ||
Logger.debug(`Caught an exception while trying to run the Django example application server.`); | ||
if (err instanceof error.TimeoutError) { | ||
console.log(` ⚠️ Python Django failed to load deployed example application server.`); | ||
console.log(` ⚠️ This issue is being reported here: `); | ||
} else { throw err; } | ||
} | ||
}); | ||
|
||
suite('Stop and remove workspace', async() => { | ||
workspaceHandler.stopWorkspace(workspaceName); | ||
workspaceHandler.removeWorkspace(workspaceName); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters