Alanren/integration setup (#4871)

* automate the setup and use akv to store values

* update readme.md

* get rid of the save to file part

* update readme

* add more messages

* fix the error

* fix some errors

* fix the readme
This commit is contained in:
Alan Ren
2019-04-08 15:11:38 -07:00
committed by GitHub
parent acc27d0829
commit e6faef27ab
11 changed files with 1095 additions and 578 deletions

View File

@@ -9,6 +9,18 @@ import 'mocha';
import * as vscode from 'vscode';
import { context } from './testContext';
import assert = require('assert');
import { getConfigValue, EnvironmentVariable_BDC_SERVER, EnvironmentVariable_BDC_USERNAME, EnvironmentVariable_BDC_PASSWORD, EnvironmentVariable_AZURE_PASSWORD, EnvironmentVariable_AZURE_SERVER, EnvironmentVariable_AZURE_USERNAME, EnvironmentVariable_STANDALONE_PASSWORD, EnvironmentVariable_STANDALONE_SERVER, EnvironmentVariable_STANDALONE_USERNAME, EnvironmentVariable_PYTHON_PATH } from './utils';
assert(getConfigValue(EnvironmentVariable_BDC_SERVER) !== undefined &&
getConfigValue(EnvironmentVariable_BDC_USERNAME) !== undefined &&
getConfigValue(EnvironmentVariable_BDC_PASSWORD) !== undefined &&
getConfigValue(EnvironmentVariable_AZURE_PASSWORD) !== undefined &&
getConfigValue(EnvironmentVariable_AZURE_SERVER) !== undefined &&
getConfigValue(EnvironmentVariable_AZURE_USERNAME) !== undefined &&
getConfigValue(EnvironmentVariable_STANDALONE_PASSWORD) !== undefined &&
getConfigValue(EnvironmentVariable_STANDALONE_SERVER) !== undefined &&
getConfigValue(EnvironmentVariable_STANDALONE_USERNAME) !== undefined &&
getConfigValue(EnvironmentVariable_PYTHON_PATH) !== undefined, 'Required environment variables are not set, if you see this error in the build pipeline, make sure the environment variables are set properly in the build definition, otherwise for local dev environment make sure you follow the instructions in the readme file.');
if (!context.RunTest) {
suite('integration test setup', () => {
@@ -18,31 +30,5 @@ if (!context.RunTest) {
//Reload the window, this is required for some changes made by the 'test.setupIntegrationTest' to work
await vscode.commands.executeCommand('workbench.action.reloadWindow');
});
test('test setup verify BDC instance variables', async function () {
console.log(`BDC_BACKEND_HOSTNAME: '${process.env.BDC_BACKEND_HOSTNAME}', BDC_BACKEND_USERNAME: '${process.env.BDC_BACKEND_USERNAME}'`);
console.log(`PYTHON_TEST_PATH: '${process.env.PYTHON_TEST_PATH}'`);
assert(process.env.BDC_BACKEND_HOSTNAME !== undefined &&
process.env.BDC_BACKEND_USERNAME !== undefined &&
process.env.BDC_BACKEND_PWD !== undefined &&
process.env.PYTHON_TEST_PATH !== undefined, 'Test setup requirs BDC_BACKEND_HOSTNAME, BDC_BACKEND_USERNAME, BDC_BACKEND_PWD, and PYTHON_TEST_PATH must be set using ./scripts/setbackenvariables.sh or .\\scripts\\setbackendvaraibles.bat');
console.log('BDC instance variables are verified.');
});
test('test setup verify standalone instance variables', async function () {
console.log(`STANDALONE_SQL: '${process.env.STANDALONE_SQL}', STANDALONE_SQL_USERNAME: '${process.env.STANDALONE_SQL_USERNAME}'`);
assert(process.env.STANDALONE_SQL !== undefined &&
process.env.STANDALONE_SQL_USERNAME !== undefined &&
process.env.STANDALONE_SQL_PWD !== undefined, 'Test setup requirs STANDALONE_SQL, STANDALONE_SQL_USERNAME and STANDALONE_SQL_PWD must be set using ./scripts/setbackenvariables.sh or .\\scripts\\setbackendvaraibles.bat');
console.log('Standalone instance variables are verified.');
});
test('test setup verify azure instance variables', async function () {
console.log(`AZURE_SQL: '${process.env.AZURE_SQL}', AZURE_SQL_USERNAME: '${process.env.AZURE_SQL_USERNAME}'`);
assert(process.env.AZURE_SQL !== undefined &&
process.env.AZURE_SQL_USERNAME !== undefined &&
process.env.AZURE_SQL_PWD !== undefined, 'Test setup requirs AZURE_SQL, AZURE_SQL_USERNAME and AZURE_SQL_PWD must be set using ./scripts/setbackenvariables.sh or .\\scripts\\setbackendvaraibles.bat');
console.log('Azure instance variables are verified.');
});
});
}