Details
-
Improvement
-
Status: Triage Needed
-
Normal
-
Resolution: Unresolved
-
None
-
None
-
All
-
None
Description
I noticed this first when dealing with (1)
Simple bash for unit tests gives:
for i in $(find . -type f -name '*Test.java'); do imports=$(grep 'import org.apache.*Test;' $i | grep -v 'Abstract'); if [ x"$imports" != "x" ]; then echo $i $imports; fi; done ./org/apache/cassandra/db/ColumnFamilyStoreTest.java import org.apache.cassandra.io.sstable.ScrubTest; ./org/apache/cassandra/db/compaction/CompactionsCQLTest.java import org.apache.cassandra.io.sstable.LegacySSTableTest; ./org/apache/cassandra/db/compaction/PartialCompactionsTest.java import org.apache.cassandra.db.DirectoriesTest; ./org/apache/cassandra/locator/ReconnectableSnitchHelperTest.java import org.apache.cassandra.net.MessagingServiceTest; ./org/apache/cassandra/tools/nodetool/ScrubToolTest.java import org.apache.cassandra.io.sstable.ScrubTest; ./org/apache/cassandra/tools/StandaloneUpgraderOnSStablesTest.java import org.apache.cassandra.io.sstable.LegacySSTableTest; ./org/apache/cassandra/tools/StandaloneVerifierTest.java import org.apache.cassandra.io.sstable.VerifyTest; ./org/apache/cassandra/tools/StandaloneVerifierOnSSTablesTest.java import org.apache.cassandra.io.sstable.VerifyTest; ./org/apache/cassandra/repair/asymmetric/DifferenceHolderTest.java import org.apache.cassandra.utils.MerkleTreesTest; ./org/apache/cassandra/repair/ValidatorTest.java import org.apache.cassandra.db.compaction.CompactionsTest; ./org/apache/cassandra/fql/FullQueryLoggerTest.java import org.apache.cassandra.utils.binlog.BinLogTest; ./org/apache/cassandra/index/sai/cql/InetAddressTypeEquivalencyTest.java import org.apache.cassandra.index.sai.cql.types.InetTest; ./org/apache/cassandra/io/compress/CompressedSequentialWriterTest.java import org.apache.cassandra.io.util.SequentialWriterTest; ./org/apache/cassandra/io/sstable/LegacySSTableTest.java import org.apache.cassandra.db.SinglePartitionSliceCommandTest; ./org/apache/cassandra/audit/BinAuditLoggerTest.java import org.apache.cassandra.utils.binlog.BinLogTest; ./org/apache/cassandra/cql3/validation/operations/CompactStorageSplit1Test.java import org.apache.cassandra.cql3.validation.entities.SecondaryIndexTest;
in-jvm-dtests:
for i in $(find . -type f -name '*Test.java'); do imports=$(grep 'import org.apache.*Test;' $i | grep -v 'Abstract'); if [ x"$imports" != "x" ]; then echo $i $imports; fi; done ./org/apache/cassandra/distributed/test/ring/BootstrapTest.java import org.apache.cassandra.distributed.test.DecommissionTest;
If one goes one by one, there are some cases when one test is truly depending on another. I do not think this is a good practice at all. Each test should be self-contained or at least all common parts which are reused should be extracted to some helper classes. As it is done right now, if one changes the implementation of some helper methods in one test, it might fail others. If it is extracted, it is more probable that a developer would check where that method is used additionally to the place a developer is focused on. Right now if a developer changes a method in a test that method is specified in, she does not have a clue that it might be used somewhere else.
Attachments
Issue Links
- relates to
-
CASSANDRA-18824 Backport CASSANDRA-16418: Cleanup behaviour during node decommission caused missing replica
- Resolved