mirror of https://gitee.com/bigwinds/arangodb
Bug fix/fiddle version string into test paths (#6267)
This commit is contained in:
parent
cfa0e0db55
commit
494764b95c
|
@ -57,7 +57,7 @@ Close and reopen the Administrator command window in order to continue with the
|
|||
|
||||
And manually install the requirements via the `Gemfile` fetched from the ArangoDB Git repository *(needs to be run with Administrator privileges)*:
|
||||
|
||||
wget https://raw.githubusercontent.com/arangodb/arangodb/devel/UnitTests/HttpInterface/Gemfile
|
||||
wget https://raw.githubusercontent.com/arangodb/arangodb/devel/tests/HttpInterface/Gemfile
|
||||
set PATH=%PATH%;C:\tools\DevKit2\bin;C:\tools\DevKit2\mingw\bin
|
||||
gem install bundler
|
||||
bundler
|
||||
|
|
|
@ -162,7 +162,7 @@ void UpgradeFeature::start() {
|
|||
}
|
||||
|
||||
LOG_TOPIC(INFO, arangodb::Logger::STARTUP)
|
||||
<< "Server will now shutdown due to upgrade, database init or admin restoration.";
|
||||
<< "server will now shut down due to upgrade, database initialization or admin restoration.";
|
||||
|
||||
server()->beginShutdown();
|
||||
}
|
||||
|
|
|
@ -77,9 +77,7 @@ install(
|
|||
${PROJECT_SOURCE_DIR}/js/apps
|
||||
${PROJECT_SOURCE_DIR}/js/server
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR_ARANGO}/${ARANGODB_JS_VERSION}
|
||||
REGEX "^.*/server/tests$" EXCLUDE
|
||||
REGEX "^.*/aardvark/APP/node_modules$" EXCLUDE
|
||||
REGEX "^.*/aardvark/APP/test$" EXCLUDE
|
||||
REGEX "^.*/.bin" EXCLUDE
|
||||
)
|
||||
|
||||
|
@ -87,9 +85,7 @@ if (USE_ENTERPRISE)
|
|||
install(
|
||||
DIRECTORY ${PROJECT_SOURCE_DIR}/enterprise/js/server
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR_ARANGO}/${ARANGODB_JS_VERSION}
|
||||
REGEX "^.*/server/tests$" EXCLUDE
|
||||
REGEX "^.*/aardvark/APP/node_modules$" EXCLUDE
|
||||
REGEX "^.*/aardvark/APP/test$" EXCLUDE
|
||||
)
|
||||
endif ()
|
||||
|
||||
|
|
|
@ -10,12 +10,6 @@ install(
|
|||
${CMAKE_INSTALL_DATAROOTDIR_ARANGO}/${ARANGODB_JS_VERSION}
|
||||
FILES_MATCHING
|
||||
PATTERN "*.js"
|
||||
REGEX
|
||||
"^.*/common/test-data$" EXCLUDE
|
||||
REGEX
|
||||
"^.*/common/tests$" EXCLUDE
|
||||
REGEX
|
||||
"^.*/client/tests$" EXCLUDE
|
||||
)
|
||||
|
||||
if (USE_ENTERPRISE)
|
||||
|
@ -25,9 +19,6 @@ if (USE_ENTERPRISE)
|
|||
${ARANGODB_SOURCE_DIR}/enterprise/js/client
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR_ARANGO}/${ARANGODB_JS_VERSION}
|
||||
FILES_MATCHING PATTERN "*.js"
|
||||
REGEX "^.*/common/test-data$" EXCLUDE
|
||||
REGEX "^.*/common/tests$" EXCLUDE
|
||||
REGEX "^.*/client/tests$" EXCLUDE
|
||||
)
|
||||
endif ()
|
||||
|
||||
|
|
|
@ -684,7 +684,7 @@ function runInRSpec (options, instanceInfo, file, addArgs) {
|
|||
}
|
||||
|
||||
args = ['--color',
|
||||
'-I', fs.join('UnitTests', 'arangodbRspecLib'),
|
||||
'-I', fs.join('tests', 'arangodbRspecLib'),
|
||||
'--format', 'd',
|
||||
'--format', 'j',
|
||||
'--out', jsonFN,
|
||||
|
|
|
@ -53,10 +53,10 @@ const RESET = require('internal').COLORS.COLOR_RESET;
|
|||
// const YELLOW = require('internal').COLORS.COLOR_YELLOW;
|
||||
|
||||
const testPaths = {
|
||||
'http_replication': [fs.join('UnitTests', 'HttpReplication')],
|
||||
'http_server': [fs.join('UnitTests', 'HttpInterface')],
|
||||
'http_replication': [tu.pathForTesting('HttpReplication', 'rb')],
|
||||
'http_server': [tu.pathForTesting('HttpInterface', 'rb')],
|
||||
'ssl_server': [tu.pathForTesting('HttpInterface', 'rb')],
|
||||
'server_http': [tu.pathForTesting('common/tests/http')],
|
||||
'ssl_server': [fs.join('UnitTests', 'HttpInterface')]
|
||||
};
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -105,7 +105,7 @@ global.DEFINE_MODULE('fs', (function () {
|
|||
// / @brief normalizes a path string
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var splitDeviceRe =
|
||||
const splitDeviceRe =
|
||||
/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
|
||||
|
||||
function normalizeUNCRoot (device) {
|
||||
|
|
|
@ -1782,20 +1782,20 @@ global.DEFINE_MODULE('internal', (function () {
|
|||
delete global.SYS_OPTIONS;
|
||||
}
|
||||
|
||||
let testsBasePath;
|
||||
exports.pathForTesting = function(path) {
|
||||
let testsBasePaths = {};
|
||||
exports.pathForTesting = function(path, prefix = 'js') {
|
||||
let fs = require('fs');
|
||||
if (testsBasePath === undefined) {
|
||||
if (!testsBasePaths.hasOwnProperty(prefix)) {
|
||||
// first invocation
|
||||
testsBasePath = 'js';
|
||||
testsBasePaths[prefix] = fs.join('tests', prefix);
|
||||
// build path with version number contained
|
||||
let versionString = exports.version.replace(/-.*$/, '');
|
||||
if (fs.isDirectory(fs.join(testsBasePath, versionString))) {
|
||||
testsBasePath = fs.join(testsBasePath, versionString);
|
||||
if (fs.isDirectory(fs.join(testsBasePaths[prefix], versionString))) {
|
||||
testsBasePaths[prefix] = fs.join(testsBasePaths[prefix], versionString);
|
||||
}
|
||||
}
|
||||
|
||||
return fs.join(testsBasePath, path);
|
||||
return fs.join(testsBasePaths[prefix], path);
|
||||
};
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -5,7 +5,7 @@ const expect = require('chai').expect;
|
|||
const FoxxManager = require('org/arangodb/foxx/manager');
|
||||
const fs = require('fs');
|
||||
const internal = require('internal');
|
||||
const basePath = fs.makeAbsolute(fs.join(internal.startupPath, 'common', 'test-data', 'apps', 'arango-auth'));
|
||||
const basePath = fs.makeAbsolute(fs.join(internal.pathForTesting('common'), 'test-data', 'apps', 'arango-auth'));
|
||||
const url = arango.getEndpoint().replace(/\+vpp/, '').replace(/^tcp:/, 'http:').replace(/^ssl:/, 'https:');
|
||||
|
||||
describe('Foxx arangoUser', function () {
|
|
@ -35,7 +35,7 @@ const helper = require('@arangodb/user-helper');
|
|||
const foxxManager = require('@arangodb/foxx/manager');
|
||||
const fs = require('fs');
|
||||
const internal = require('internal');
|
||||
const basePath = fs.makeAbsolute(fs.join(internal.startupPath, 'common', 'test-data', 'apps'));
|
||||
const basePath = fs.makeAbsolute(fs.join(internal.pathForTesting('common'), 'test-data', 'apps'));
|
||||
const download = internal.download;
|
||||
const request = require('@arangodb/request');
|
||||
|
|
@ -39,7 +39,7 @@ const dbName = helper.dbName;
|
|||
const rightLevels = helper.rightLevels;
|
||||
const errors = require('@arangodb').errors;
|
||||
const fs = require('fs');
|
||||
const basePath = fs.makeAbsolute(fs.join(require('internal').startupPath, 'common', 'test-data', 'apps'));
|
||||
const basePath = fs.makeAbsolute(fs.join(require('internal').pathForTesting('common'), 'test-data', 'apps'));
|
||||
|
||||
const userSet = helper.userSet;
|
||||
const systemLevel = helper.systemLevel;
|
|
@ -8,7 +8,7 @@ const util = require('@arangodb/util');
|
|||
const fs = require('fs');
|
||||
const internal = require('internal');
|
||||
const path = require('path');
|
||||
const basePath = path.resolve(internal.startupPath, 'common', 'test-data', 'apps', 'headers');
|
||||
const basePath = path.resolve(internal.pathForTesting('common'), 'test-data', 'apps', 'headers');
|
||||
const arangodb = require('@arangodb');
|
||||
const db = arangodb.db;
|
||||
const aql = arangodb.aql;
|
||||
|
@ -143,13 +143,13 @@ describe('FoxxApi commit', function () {
|
|||
|
||||
describe('Foxx service', () => {
|
||||
const mount = '/foxx-crud-test';
|
||||
const basePath = path.resolve(internal.startupPath, 'common', 'test-data', 'apps', 'minimal-working-service');
|
||||
const itzPath = path.resolve(internal.startupPath, 'common', 'test-data', 'apps', 'itzpapalotl');
|
||||
const basePath = path.resolve(internal.pathForTesting('common'), 'test-data', 'apps', 'minimal-working-service');
|
||||
const itzPath = path.resolve(internal.pathForTesting('common'), 'test-data', 'apps', 'itzpapalotl');
|
||||
var utils = require('@arangodb/foxx/manager-utils');
|
||||
const servicePath = utils.zipDirectory(basePath);
|
||||
|
||||
const serviceServiceMount = '/foxx-crud-test-download';
|
||||
const serviceServicePath = path.resolve(internal.startupPath, 'common', 'test-data', 'apps', 'service-service', 'index.js');
|
||||
const serviceServicePath = path.resolve(internal.pathForTesting('common'), 'test-data', 'apps', 'service-service', 'index.js');
|
||||
|
||||
beforeEach(() => {
|
||||
FoxxManager.install(serviceServicePath, serviceServiceMount);
|
||||
|
@ -283,7 +283,7 @@ describe('Foxx service', () => {
|
|||
expect(resp.status).to.equal(404);
|
||||
});
|
||||
|
||||
const confPath = path.resolve(internal.startupPath, 'common', 'test-data', 'apps', 'with-configuration');
|
||||
const confPath = path.resolve(internal.pathForTesting('common'), 'test-data', 'apps', 'with-configuration');
|
||||
|
||||
it('empty configuration should be available', () => {
|
||||
FoxxManager.install(basePath, mount);
|
||||
|
@ -667,7 +667,7 @@ describe('Foxx service', () => {
|
|||
expect(resp.json).not.to.have.property('test2');
|
||||
});
|
||||
|
||||
const depPath = path.resolve(internal.startupPath, 'common', 'test-data', 'apps', 'with-dependencies');
|
||||
const depPath = path.resolve(internal.pathForTesting('common'), 'test-data', 'apps', 'with-dependencies');
|
||||
|
||||
it('empty configuration should be available', () => {
|
||||
FoxxManager.install(basePath, mount);
|
||||
|
@ -1117,7 +1117,7 @@ describe('Foxx service', () => {
|
|||
expect(util.isZipBuffer(resp.body)).to.equal(true);
|
||||
});
|
||||
|
||||
const readmePath = path.resolve(internal.startupPath, 'common', 'test-data', 'apps', 'with-readme');
|
||||
const readmePath = path.resolve(internal.pathForTesting('common'), 'test-data', 'apps', 'with-readme');
|
||||
|
||||
it('should deliver the readme', () => {
|
||||
FoxxManager.install(readmePath, mount);
|
||||
|
@ -1190,7 +1190,7 @@ describe('Foxx service', () => {
|
|||
expect(service.checksum).to.be.a('string');
|
||||
});
|
||||
|
||||
const scriptPath = path.resolve(internal.startupPath, 'common', 'test-data', 'apps', 'minimal-working-setup-teardown');
|
||||
const scriptPath = path.resolve(internal.pathForTesting('common'), 'test-data', 'apps', 'minimal-working-setup-teardown');
|
||||
|
||||
it('list of scripts should be available', () => {
|
||||
FoxxManager.install(scriptPath, mount);
|
||||
|
@ -1222,7 +1222,7 @@ describe('Foxx service', () => {
|
|||
expect(resp.status).to.equal(400);
|
||||
});
|
||||
|
||||
const echoPath = path.resolve(internal.startupPath, 'common', 'test-data', 'apps', 'echo-script');
|
||||
const echoPath = path.resolve(internal.pathForTesting('common'), 'test-data', 'apps', 'echo-script');
|
||||
|
||||
it('should pass argv to script and return exports', () => {
|
||||
FoxxManager.install(echoPath, mount);
|
||||
|
@ -1327,7 +1327,7 @@ describe('Foxx service', () => {
|
|||
}
|
||||
|
||||
it('tests should run', () => {
|
||||
const testPath = path.resolve(internal.startupPath, 'common', 'test-data', 'apps', 'with-tests');
|
||||
const testPath = path.resolve(internal.pathForTesting('common'), 'test-data', 'apps', 'with-tests');
|
||||
FoxxManager.install(testPath, mount);
|
||||
const resp = request.post('/_api/foxx/tests', {qs: { mount }});
|
||||
expect(resp.status).to.equal(200);
|
|
@ -5,7 +5,7 @@ var expect = require('chai').expect;
|
|||
var FoxxManager = require('org/arangodb/foxx/manager');
|
||||
var fs = require('fs');
|
||||
var internal = require('internal');
|
||||
var basePath = fs.makeAbsolute(fs.join(internal.startupPath, 'common', 'test-data', 'apps', 'headers'));
|
||||
var basePath = fs.makeAbsolute(fs.join(internal.pathForTesting('common'), 'test-data', 'apps', 'headers'));
|
||||
var origin = arango.getEndpoint().replace(/\+vpp/, '').replace(/^tcp:/, 'http:').replace(/^ssl:/, 'https:');
|
||||
|
||||
describe('HTTP headers in Foxx services', function () {
|
|
@ -32,7 +32,7 @@ const FoxxManager = require('@arangodb/foxx/manager');
|
|||
const ArangoCollection = require('@arangodb').ArangoCollection;
|
||||
const fs = require('fs');
|
||||
const db = require('internal').db;
|
||||
const basePath = fs.makeAbsolute(fs.join(require('internal').startupPath, 'common', 'test-data', 'apps'));
|
||||
const basePath = fs.makeAbsolute(fs.join(require('internal').pathForTesting('common'), 'test-data', 'apps'));
|
||||
const arango = require('@arangodb').arango;
|
||||
const originalEndpoint = arango.getEndpoint().replace(/localhost/, '127.0.0.1');
|
||||
const expect = require('chai').expect;
|
|
@ -8,7 +8,7 @@ const db = require('internal').db;
|
|||
const arangodb = require('@arangodb');
|
||||
const arango = require('@arangodb').arango;
|
||||
const aql = arangodb.aql;
|
||||
const basePath = fs.makeAbsolute(fs.join(require('internal').startupPath, 'common', 'test-data', 'apps'));
|
||||
const basePath = fs.makeAbsolute(fs.join(require('internal').pathForTesting('common'), 'test-data', 'apps'));
|
||||
const expect = require('chai').expect;
|
||||
const download = require('internal').download;
|
||||
|
|
@ -5,7 +5,7 @@ const fm = require('@arangodb/foxx/manager');
|
|||
const request = require('@arangodb/request');
|
||||
const fs = require('fs');
|
||||
const internal = require('internal');
|
||||
const basePath = fs.makeAbsolute(fs.join(internal.startupPath, 'common', 'test-data', 'apps'));
|
||||
const basePath = fs.makeAbsolute(fs.join(internal.pathForTesting('common'), 'test-data', 'apps'));
|
||||
const arango = require('@arangodb').arango;
|
||||
const baseUrl = arango.getEndpoint().replace('tcp://', 'http://') + '/_db/_system';
|
||||
|
|
@ -34,7 +34,7 @@ const expect = require('chai').expect;
|
|||
const foxxManager = require('@arangodb/foxx/manager');
|
||||
const fs = require('fs');
|
||||
const internal = require('internal');
|
||||
const basePath = fs.makeAbsolute(fs.join(internal.startupPath, 'common', 'test-data', 'apps'));
|
||||
const basePath = fs.makeAbsolute(fs.join(internal.pathForTesting('common'), 'test-data', 'apps'));
|
||||
const download = internal.download;
|
||||
const request = require('@arangodb/request');
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue