Conversation
@justinleet wowowow, this is an awesome contribution. It's going to take me a bit of time to work through this.
Any reason we specifically still need/want PowerMock? That was purely for special static mocking purposes, right? Personally, I'm happy to see this cleaned this up and have our testing infrastructure as super simple JUnit + Mockito.
Can you link that here? Sounds like a reasonable drop, per your description. |
To the best of my knowledge, no, we don't. Nothing we were doing was super out there. What I generally did was expose a bit more state; it suggests refactoring might make that cleaner, but it's way out of scope and honestly probably low priority anyway. I actually made sure to drop it from all the poms. If there's any PowerMock left, it's an oversight.
|
@mmiklavc Given how large this PR is, here's a git command that should just pull out the
List of files (from
For completeness, if you only want the poms:
|
Running dev up gives some issues starting index
None of the pom changes touch anything involving Storm/Flux, so I'm not sure what the disconnect is, and I'll have to dig in more, but if there's any leads/knowledge from the Storm upgrade stuff, I'd be happy to hear it. |
@justinleet The HDP 3.1 upgrade work hasn't landed in master yet, so that should not be the cause of any problems. I will try and take a look too when I get some free cycles. |
@nickwallen I meant more the last upgrade cycle. Right now we package up storm 1.0.x stuff, but dev deploys Storm 1.1.0, I believe. I'm wondering if that's causing some issues. Having said that, I would totally appreciate any insight you have to offer. There's not a huge rush, I have to free up some cycles myself to look into it. |
I added the commit from #1557 into here. It seems to resolve the problem, but I'm honestly not sure entirely why. I assume some mismatched versions were being carried along and the changed dependencies caused issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another 150 files down, 247 to go :)
...s/src/test/java/org/apache/metron/statistics/approximation/HyperLogLogPlusFunctionsTest.java
Show resolved
Hide resolved
...atistics/src/test/java/org/apache/metron/statistics/outlier/MedianAbsoluteDeviationTest.java
Show resolved
Hide resolved
...metron-rest/src/test/java/org/apache/metron/rest/config/KnoxSSOAuthenticationFilterTest.java
Outdated
Show resolved
Hide resolved
...rface/metron-rest/src/test/java/org/apache/metron/rest/service/impl/GrokServiceImplTest.java
Show resolved
Hide resolved
...g/metron-common-storm/src/test/java/org/apache/metron/storm/common/utils/ErrorUtilsTest.java
Outdated
Show resolved
Hide resolved
...n/src/test/java/org/apache/metron/common/field/transformation/StellarTransformationTest.java
Show resolved
Hide resolved
.../metron-common/src/test/java/org/apache/metron/common/performance/PerformanceLoggerTest.java
Outdated
Show resolved
Hide resolved
...rch-common/src/test/java/org/apache/metron/elasticsearch/writer/ElasticsearchWriterTest.java
Outdated
Show resolved
Hide resolved
...ng/metron-indexing-common/src/main/java/org/apache/metron/indexing/dao/search/SortField.java
Show resolved
Hide resolved
...-common/src/test/java/org/apache/metron/indexing/dao/metaalert/MetaAlertIntegrationTest.java
Outdated
Show resolved
Hide resolved
...-common/src/test/java/org/apache/metron/indexing/dao/metaalert/MetaAlertIntegrationTest.java
Outdated
Show resolved
Hide resolved
...-common/src/test/java/org/apache/metron/indexing/dao/metaalert/MetaAlertIntegrationTest.java
Outdated
Show resolved
Hide resolved
...-common/src/test/java/org/apache/metron/indexing/dao/metaalert/MetaAlertIntegrationTest.java
Outdated
Show resolved
Hide resolved
...-common/src/test/java/org/apache/metron/indexing/dao/metaalert/MetaAlertIntegrationTest.java
Outdated
Show resolved
Hide resolved
...-common/src/test/java/org/apache/metron/indexing/dao/metaalert/MetaAlertIntegrationTest.java
Outdated
Show resolved
Hide resolved
...ron-management/src/test/java/org/apache/metron/management/EnrichmentConfigFunctionsTest.java
Show resolved
Hide resolved
...rm/metron-management/src/test/java/org/apache/metron/management/FileSystemFunctionsTest.java
Show resolved
Hide resolved
...rm/metron-management/src/test/java/org/apache/metron/management/FileSystemFunctionsTest.java
Outdated
Show resolved
Hide resolved
...arsing-storm/src/test/java/org/apache/metron/parsers/topology/ParserTopologyBuilderTest.java
Outdated
Show resolved
Hide resolved
...ap-backend/src/test/java/org/apache/metron/pcap/integration/PcapTopologyIntegrationTest.java
Show resolved
Hide resolved
@mmiklavc This is pretty important, so I'm flagging you directly on the comment. I'm looking into some weirdness with our The difference between local and Travis seems to be that our shell scripts are faulty. They try to To see this sort of thing in action:
This will still run the grep on test, and because the grep succeeds, the return code is 0. I've changed this branch to reflect, and |
Unrelated, the older things like JUnit 3.8.1 that come in from dependencies that are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now made it through the entire change list. I'll start circling back to your recent comments and fixes now @justinleet.
...tron-solr/metron-solr-common/src/test/java/org/apache/metron/solr/dao/SolrSearchDaoTest.java
Show resolved
Hide resolved
@mmiklavc merged in master and resolved conflicts. I think everything's been taken care of or address. I don't recall, are you able to resolve conversations you've started that have been taken care of or am I the only one that can do it? |
@justinleet 2 minor comments and I think we're about there. |
+1. Huge contribution @justinleet, thanks and nice work! |
Many thanks @justinleet! Kudos for the contribution. |
Contributor Comments
Moves to JUnit 5. This came out of my forever ago desire to look into JUnit5 extensions to share test infra (Kafka, ZK, etc.) across our test classes, rather than spin up for each class.
assertThrows
@Rule
s left are for temporary directories. This feature is experimental in JUnit5 (although I do use it once for a@ClassRule
one. We could potentially migrate over, it's not like it'd be a huge deal to upgrade to whatever they choose in the future.MetronRestApplication
, iirc. Didn't seem super helpful to test that it ran theSpringApplication
.Build works (potentially barring the last couple cleanup commits which are going through my personal Travis), but I still need to spin it up on dev.
I'm not super thrilled about this being a large PR, but it was an enormous pain that kept finding things backwards in modules I thought I'd already cleared. It could probably be split out, but I'll be honest: If I see that request, I'll probably ignore it for awhile.
Pull Request Checklist
Thank you for submitting a contribution to Apache Metron.
Please refer to our Development Guidelines for the complete guide to follow for contributions.
Please refer also to our Build Verification Guidelines for complete smoke testing guides.
In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following:
For all changes:
For code changes:
Have you included steps to reproduce the behavior or problem that is being changed or addressed?
Have you included steps or a guide to how the change may be verified and tested manually?
Have you ensured that the full suite of tests and checks have been executed in the root metron folder via:
Have you written or updated unit tests and or integration tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
For documentation related changes:
Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via
site-book/target/site/index.html
:Have you ensured that any documentation diagrams have been updated, along with their source files, using draw.io? See Metron Development Guidelines for instructions.
Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
It is also recommended that travis-ci is set up for your personal repository such that your branches are built there before submitting a pull request.