8000 Bug fix/internal issue #651 by gnusi · Pull Request #10415 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Bug fix/internal issue #651 #10415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 13, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
gnusi committed Nov 13, 2019
commit 43302bfea96d70f27c701512c2f89b3e1ac90518
28 changes: 2 additions & 26 deletions tests/IResearch/IResearchAnalyzerFeature-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ class IResearchAnalyzerFeatureTest
arangodb::SystemDatabaseFeature* sysDatabaseFeature{};

IResearchAnalyzerFeatureTest() : server(false) {
arangodb::tests::init(true);
arangodb::tests::init();

server.addFeature<arangodb::QueryRegistryFeature>(false);
server.addFeature<arangodb::TraverserEngineRegistryFeature>(false);
Expand Down Expand Up @@ -803,7 +803,6 @@ TEST_F(IResearchAnalyzerFeatureTest, test_renormalize_for_equal) {

class IResearchAnalyzerFeatureGetTest : public IResearchAnalyzerFeatureTest {
protected:
arangodb::AqlFeature& aqlFeature;
arangodb::iresearch::IResearchAnalyzerFeature& analyzerFeature;
std::string dbName;

Expand All @@ -814,7 +813,6 @@ class IResearchAnalyzerFeatureGetTest : public IResearchAnalyzerFeatureTest {
protected:
IResearchAnalyzerFeatureGetTest()
: IResearchAnalyzerFeatureTest(),
aqlFeature(server.addFeatureUntracked<arangodb::AqlFeature>()),
analyzerFeature(server.addFeatureUntracked<arangodb::iresearch::IResearchAnalyzerFeature>()),
dbName("testVocbase") {}

Expand All @@ -839,9 +837,6 @@ class IResearchAnalyzerFeatureGetTest : public IResearchAnalyzerFeatureTest {
VPackParser::fromJson("\"abc\"")->slice()).ok());
ASSERT_TRUE(feature().emplace(result, specificName(), "TestAnalyzer",
VPackParser::fromJson("\"def\"")->slice()).ok());

// required for Query::Query(...), must not call ~AqlFeature() for the duration of the test
aqlFeature.start();
}

void TearDown() override {
Expand All @@ -850,7 +845,6 @@ class IResearchAnalyzerFeatureGetTest : public IResearchAnalyzerFeatureTest {
server.getFeature<arangodb::DatabaseFeature>().dropDatabase(dbName, true, true);
_vocbase = nullptr;
}
aqlFeature.stop();
analyzerFeature.unprepare();
}

Expand Down Expand Up @@ -1031,7 +1025,7 @@ class IResearchAnalyzerFeatureCoordinatorTest
_feature(server.getFeature<arangodb::iresearch::IResearchAnalyzerFeature>()) {
arangodb::tests::init();

server.addFeature<arangodb::ViewTypesFeature>(true);
//server.addFeature<arangodb::ViewTypesFeature>(true);

TransactionStateMock::abortTransactionCount = 0;
TransactionStateMock::beginTransactionCount = 0;
Expand Down Expand Up @@ -1906,8 +1900,6 @@ TEST_F(IResearchAnalyzerFeatureTest, test_remove) {

ASSERT_TRUE(server.server().hasFeature<arangodb::DatabaseFeature>());
auto& dbFeature = server.getFeature<arangodb::DatabaseFeature>();
arangodb::AqlFeature aqlFeature(server.server());
aqlFeature.start(); // required for Query::Query(...), must not call ~AqlFeature() for the duration of the test

// remove existing
{
Expand Down Expand Up @@ -1969,10 +1961,6 @@ TEST_F(IResearchAnalyzerFeatureTest, test_remove) {
newServer.addFeature<arangodb::application_features::CommunicationFeaturePhase>(); // required for SimpleHttpClient::doRequest>(std::make_unique<arangodb::application_features::CommunicationFeaturePhase(newServer)); // required for SimpleHttpClient::doRequest>()
auto& feature =
newServer.addFeature<arangodb::iresearch::IResearchAnalyzerFeature>(); // required for running upgrade task
arangodb::aql::OptimizerRulesFeature(this->server.server()).prepare(); // required for Query::preparePlan(...)
auto clearOptimizerRules = irs::make_finally([this]() -> void {
arangodb::aql::OptimizerRulesFeature(this->server.server()).unprepare();
});

auto cleanup = arangodb::scopeGuard([&dbFeature]() { dbFeature.unprepare(); });

Expand Down Expand Up @@ -2033,10 +2021,6 @@ TEST_F(IResearchAnalyzerFeatureTest, test_remove) {
newServer.addFeature<arangodb::application_features::CommunicationFeaturePhase>(); // required for SimpleHttpClient::doRequest()
auto& feature =
newServer.addFeature<arangodb::iresearch::IResearchAnalyzerFeature>(); // required for running upgrade task
arangodb::aql::OptimizerRulesFeature(this->server.server()).prepare(); // required for Query::preparePlan(...)
auto clearOptimizerRules = irs::make_finally([this]() -> void {
arangodb::aql::OptimizerRulesFeature(this->server.server()).unprepare();
});

auto cleanup = arangodb::scopeGuard([&dbFeature]() { dbFeature.unprepare(); });

Expand Down Expand Up @@ -2952,25 +2936,17 @@ class IResearchAnalyzerFeatureUpgradeStaticLegacyTest : public IResearchAnalyzer
VPackParser::fromJson("{ \"version\": 0, \"tasks\": {} }");

private:
arangodb::AqlFeature& aqlFeature;
arangodb::aql::OptimizerRulesFeature& rulesFeature;
arangodb::DatabasePathFeature& dbPathFeature;

protected:
IResearchAnalyzerFeatureUpgradeStaticLegacyTest()
: IResearchAnalyzerFeatureTest(),
dbFeature(server.getFeature<arangodb::DatabaseFeature>()),
sysDatabase(server.getFeature<arangodb::SystemDatabaseFeature>()),
aqlFeature(server.addFeatureUntracked<arangodb::AqlFeature>()),
rulesFeature(server.addFeatureUntracked<arangodb::aql::OptimizerRulesFeature>()),
dbPathFeature(server.getFeature<arangodb::DatabasePathFeature>()) {
aqlFeature.start();
rulesFeature.prepare();
}

~IResearchAnalyzerFeatureUpgradeStaticLegacyTest() {
rulesFeature.unprepare();
aqlFeature.stop();
}
};

Expand Down
0