[ 
https://issues.apache.org/jira/browse/CASSANDRA-17964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17618915#comment-17618915
 ] 

Stefan Miklosovic commented on CASSANDRA-17964:
-----------------------------------------------

I dont think you are shoveling anything tbh.

I tried this regexp:
{code:java}
^(?!(?:Test))(?!.*?(?:Tests)).*$
{code}
These are the failures:
{code:java}
/anttasks/TestHelper.java:26:14: Name 'TestHelper' must match pattern 
'^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/distributed/org/apache/cassandra/distributed/test/TestBaseImpl.java:47:14: 
Name 'TestBaseImpl' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. 
[TypeName]
/distributed/org/apache/cassandra/distributed/upgrade/UpgradeTestBase.java:113:25:
 Name 'TestVersions' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. 
[TypeName]
/distributed/org/apache/cassandra/distributed/upgrade/UpgradeTestBase.java:151:25:
 Name 'TestCase' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. 
[TypeName]
/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java:72:25: Name 
'TestLoader' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/cql3/validation/entities/VirtualTableTest.java:990:25:
 Name 'TestTrigger' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. 
[TypeName]
/unit/org/apache/cassandra/cql3/validation/operations/CreateTest.java:767:25: 
Name 'TestTrigger' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. 
[TypeName]
/unit/org/apache/cassandra/db/memtable/TestMemtable.java:23:14: Name 
'TestMemtable' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/diag/DiagnosticEventServiceTest.java:214:25: Name 
'TestEvent1' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/diag/DiagnosticEventServiceTest.java:227:25: Name 
'TestEvent2' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/index/SecondaryIndexManagerTest.java:664:25: Name 
'TestingIndex' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java:627:18: Name 
'TestScript' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/metrics/DecayingEstimatedHistogramReservoirTest.java:613:29:
 Name 'TestClock' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. 
[TypeName]
/unit/org/apache/cassandra/metrics/TestMe.java:21:14: Name 'TestMe' must match 
pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/metrics/TestsMe.java:21:14: Name 'TestsMe' must 
match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/metrics/TheseTestsMe.java:21:14: Name 'TheseTestsMe' 
must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/net/TestChannel.java:35:14: Name 'TestChannel' must 
match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/net/TestScheduledFuture.java:27:14: Name 
'TestScheduledFuture' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. 
[TypeName]
/unit/org/apache/cassandra/net/proxy/ProxyHandlerTest.java:213:25: Name 
'TestHandler' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/schema/RemoveWithoutDroppingTest.java:65:25: Name 
'TestSchemaUpdateHandlerFactory' must match pattern 
'^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/security/SSLFactoryTest.java:359:25: Name 
'TestFileBasedSSLContextFactory' must match pattern 
'^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/service/reads/repair/TestableReadRepair.java:40:14: 
Name 'TestableReadRepair' must match pattern 
'^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/transport/MessagePayloadTest.java:379:25: Name 
'TestQueryHandler' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. 
[TypeName]
/unit/org/apache/cassandra/triggers/TriggersTest.java:208:25: Name 
'TestTrigger' must match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/utils/TestKiller.java:26:14: Name 'TestKiller' must 
match pattern '^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
/unit/org/apache/cassandra/utils/concurrent/AbstractTransactionalTest.java:152:34:
 Name 'TestableTransaction' must match pattern 
'^(?!(?:Test))(?!.*?(?:Tests)).*$'. [TypeName]
{code}
Notice there is also "TestMe" and "TestsMe" (added my myself) so it covers 
tests starting on "Test" as well. All errors starts on "Test" or "Testing".

"MyTestBase" is not caught so it is considered to be OK (which is what we 
actually want).

There are examples of failures where test itself is named just fine but it 
contains illegal names of classes in it. For example, 
"AbstractTransactionalTest" contains "TestableTransaction" which is public 
static class in AbstractTransactionalTest. Checkstyle is doing the check on all 
types, not on "java files". The solution here is to make that static class 
protected as I am filtering that in checkstyle config so only public classes 
are checked (and tests happen to be public). Anything else does not need to be 
public for the sake of testing it. E.g TestableTransaction does not need to be 
public at all.

Other example - TestTrigger should be renamed to "TriggerForTesting" etc.

A lot of violations are easilly solvable by having visibility equal to anything 
but "public".

I can go through this and try to rename / resolve it all, lets try to do this 
properly ...

> Some tests are never executed due to naming violation - fix it and add 
> checkstyle where applicable
> --------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-17964
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17964
>             Project: Cassandra
>          Issue Type: Task
>          Components: Test/unit
>            Reporter: Ruslan Fomkin
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>             Fix For: 3.0.x, 3.11.x, 4.0.x, 4.1.x, 4.x
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> [BatchTests|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/cql3/BatchTests.java]
>  doesn't follow naming convention to be run as unit tests and, thus, is never 
> run.
> The rule in build expects names as `*Test`.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to