removing/disabling explicit test files for quick running unit tests, and converting actor fuzz to a unit test

This commit is contained in:
Josh Slocum 2023-06-07 10:29:42 -05:00
parent ea2b611061
commit 07dd44d659
6 changed files with 35 additions and 74 deletions

View File

@ -0,0 +1,31 @@
/*
* ActorFuzzUnitTest.cpp
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2013-2023 Apple Inc. and the FoundationDB project authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "fdbrpc/ActorFuzz.h"
#include "flow/UnitTest.h"
// Only used to link unit tests
void forceLinkActorFuzzUnitTests() {}
TEST_CASE("/actorFuzz") {
std::pair<int, int> result = actorFuzzTests();
ASSERT(result.first == result.second);
return Void();
}

View File

@ -1,54 +0,0 @@
/*
* Fuzz.cpp
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2013-2022 Apple Inc. and the FoundationDB project authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "fdbrpc/ActorFuzz.h"
#include "fdbserver/TesterInterface.actor.h"
#include "fdbserver/workloads/workloads.actor.h"
struct ActorFuzzWorkload : TestWorkload {
static constexpr auto NAME = "ActorFuzz";
bool enabled;
std::pair<int, int> fuzzResults;
ActorFuzzWorkload(WorkloadContext const& wcx) : TestWorkload(wcx), fuzzResults(std::make_pair(0, 0)) {
enabled = !clientId; // only do this on the "first" client
}
Future<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
if (enabled) {
// Only include this test outside of Windows because of MSVC compiler bug
fuzzResults.second = 0;
// Only include this test outside of Windows because of MSVC compiler bug
#ifndef WIN32
fuzzResults = actorFuzzTests();
#endif
if (fuzzResults.second == 0)
// if there are no total tests, then mark this as "non-passing"
fuzzResults.first = 1;
}
return Void();
}
Future<bool> check(Database const& cx) override { return fuzzResults.first == fuzzResults.second; }
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<ActorFuzzWorkload> ActorFuzzWorkloadFactory;

View File

@ -53,6 +53,7 @@ void forceLinkWipedStringTests();
void forceLinkRandomKeyValueUtilsTests();
void forceLinkSimKmsVaultTests();
void forceLinkRESTSimKmsVaultTest();
void forceLinkActorFuzzUnitTests();
struct UnitTestWorkload : TestWorkload {
static constexpr auto NAME = "UnitTests";
@ -121,6 +122,7 @@ struct UnitTestWorkload : TestWorkload {
forceLinkRandomKeyValueUtilsTests();
forceLinkSimKmsVaultTests();
forceLinkRESTSimKmsVaultTest();
forceLinkActorFuzzUnitTests();
}
Future<Void> setup(Database const& cx) override {

View File

@ -141,7 +141,6 @@ if(WITH_PYTHON)
add_fdb_test(TEST_FILES fast/BackupCorrectnessClean.toml)
add_fdb_test(TEST_FILES fast/BackupToDBCorrectness.toml)
add_fdb_test(TEST_FILES fast/BackupToDBCorrectnessClean.toml)
add_fdb_test(TEST_FILES fast/BlobCipherUnitTest.toml)
add_fdb_test(TEST_FILES fast/BlobGranuleVerifyAtomicOps.toml)
add_fdb_test(TEST_FILES fast/BlobGranuleVerifyCycle.toml)
add_fdb_test(TEST_FILES fast/BlobGranuleVerifySmall.toml)
@ -168,7 +167,8 @@ if(WITH_PYTHON)
add_fdb_test(TEST_FILES fast/ChangeFeedOperationsMove.toml)
add_fdb_test(TEST_FILES fast/DataLossRecovery.toml)
add_fdb_test(TEST_FILES fast/EncryptionOps.toml)
add_fdb_test(TEST_FILES fast/EncryptionUnitTests.toml)
# EncryptionUnitTests is only a convenience file to run the different types of encryption tests at once. Do not enable in general ensembles
add_fdb_test(TEST_FILES fast/EncryptionUnitTests.toml IGNORE)
add_fdb_test(TEST_FILES fast/EncryptKeyProxyTest.toml)
add_fdb_test(TEST_FILES fast/FuzzApiCorrectness.toml)
add_fdb_test(TEST_FILES fast/FuzzApiCorrectnessClean.toml)
@ -264,7 +264,6 @@ if(WITH_PYTHON)
add_fdb_test(TEST_FILES rare/CycleWithDeadHall.toml)
add_fdb_test(TEST_FILES rare/DataDistributionMetrics.toml)
add_fdb_test(TEST_FILES rare/DcLag.toml)
add_fdb_test(TEST_FILES rare/FuzzTest.toml)
add_fdb_test(TEST_FILES rare/HighContentionPrefixAllocator.toml)
add_fdb_test(TEST_FILES rare/InventoryTestHeavyWrites.toml)
add_fdb_test(TEST_FILES rare/LargeApiCorrectness.toml)

View File

@ -1,11 +0,0 @@
[[knobs]]
enable_configurable_encryption = true
[[test]]
testTitle = 'BlobCipherUnitTest'
useDB = false
startDelay = 0
[[test.workload]]
testName = 'UnitTests'
testsMatching = '/blobCipher'

View File

@ -1,6 +0,0 @@
[[test]]
testTitle = 'FuzzTest'
useDB = false
[[test.workload]]
testName = 'ActorFuzz'