You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metron.apache.org by justinleet <gi...@git.apache.org> on 2017/06/07 03:10:17 UTC

[GitHub] metron pull request #612: METRON-962: Configuration Based Unit Tests and Add...

GitHub user justinleet opened a pull request:

    https://github.com/apache/metron/pull/612

    METRON-962: Configuration Based Unit Tests and Add integration tests

    ## Contributor Comments
    
    Admittedly, this mixes a couple things together.  I originally intended to get rid of JUnit3 code, and ended up having to untangle the config based testing.  This dovetails with https://github.com/apache/metron/pull/579.  It can be separated if desired (it's primarily just changing imports).
    
    The primary change is to rip out a ton of stuff around the configuration testing that seemed entirely pointless.  It hasn't run in forever anyway, so cutting it down and leaving just straightforward unit tests seemed much more reasonable.
    
    METRON-962 technically isn't probably quite complete, because I didn't add any integration tests or anything to this, but I'd rather split that into a separate JIRA and just consider this one "getting the integration tests working".  If we want to do that, I can adjust ticket name (or we can leave it as-is).
    
    The GrokAsaParserTest works now, but required changes to the parser.  One is to point to the correct resource location, and the other is to refer to the specific cisco tag element.  I think this is valid and I'm honestly pretty sure it didn't work before on the basis of the resource location.  If someone can prove me wrong, I'm inclined to revert the parser and just leave the test `@Ignore`.  Does anything even use this parser? Could we just outright delete it?
    
    `BasicFireEyeParser` has a `System.out.println` commented out.  I'd delete it, but everything else is commented in that file, so I just commented it out.
    
    There is some minor duplication in some of the `@Test` methods, but I'm not sure we care to refactor it much more than this.
    
    https://github.com/apache/metron/pull/88 appears to have deleted the test files, but I don't know if there was any actual intent.  I assume they just got lost in the shuffle.  They are restored and slightly renamed.
    
    ## Pull Request Checklist
    
    Thank you for submitting a contribution to Apache Metron.  
    Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions.  
    Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) 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:
    - [x] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). 
    - [x] Does your PR title start with METRON-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    - [x] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    
    ### For code changes:
    - [x] Have you included steps to reproduce the behavior or problem that is being changed or addressed?
    - [x] 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 incubating-metron folder via:
      ```
      mvn -q clean integration-test install && build_utils/verify_licenses.sh 
      ```
    
    - [x] Have you written or updated unit tests and or integration tests to verify your changes?
    - [ ] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent?
    
    #### 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](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/justinleet/metron test_refactor

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/metron/pull/612.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #612
    
----
commit d6a00299672c3a6a749a8b725feb08270c31489f
Author: justinjleet <ju...@gmail.com>
Date:   2017-05-13T11:52:12Z

    wip

commit 5a0258343078c3798cc116a1a9f71988a9ae492d
Author: justinjleet <ju...@gmail.com>
Date:   2017-05-13T11:52:46Z

    rest of stuff

commit 96290dd12f00d46cb347f7c6086098e7a9ca887d
Author: justinjleet <ju...@gmail.com>
Date:   2017-06-07T02:49:55Z

    Formatting plus getting GrokAsaParser working

commit cc3679eb3ddaf8c95ca792256fc5ba0c16e79953
Author: justinjleet <ju...@gmail.com>
Date:   2017-06-07T02:53:29Z

    Merge branch 'master' into test_refactor

commit 66d8f2800da058ee4cabf7c86da90a5bb3fc1734
Author: justinjleet <ju...@gmail.com>
Date:   2017-06-07T03:01:59Z

    adjusting license back

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] metron issue #612: METRON-962: Configuration Based Unit Tests and Add integr...

Posted by kylerichardson <gi...@git.apache.org>.
Github user kylerichardson commented on the issue:

    https://github.com/apache/metron/pull/612
  
    'GrokAsaParser' is legacy OpenSOC I believe. It has been broken for some time and when I rewrote the ASA parser I did it as 'BasicAsaParser'.
    
    @justinleet Thanks for cleaning this up! I'm +1 for dropping 'GrokAsaParser'.
    
    -Kyle
    
    > On Jun 7, 2017, at 8:58 AM, justinleet <no...@github.com> wrote:
    > 
    > @kylerichardson What is the difference between the BasicAsaParser and the GrokAsaParser? Are you able to shed some light on why both exist? The motivation for the question is that minor changes had to be made to the GrokAsaParser to get unit tests (and possibly the parser itself working).
    > 
    > —
    > You are receiving this because you were mentioned.
    > Reply to this email directly, view it on GitHub, or mute the thread.
    > 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] metron issue #612: METRON-962: Configuration Based Unit Tests and Add integr...

Posted by ottobackwards <gi...@git.apache.org>.
Github user ottobackwards commented on the issue:

    https://github.com/apache/metron/pull/612
  
    +1 by inspection - @justinleet did you assign the jira over?
    I will have to port this to 777 when it hits.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] metron issue #612: METRON-962: Configuration Based Unit Tests and Add integr...

Posted by justinleet <gi...@git.apache.org>.
Github user justinleet commented on the issue:

    https://github.com/apache/metron/pull/612
  
    @kylerichardson What is the difference between the `BasicAsaParser` and the `GrokAsaParser`? Are you able to shed some light on why both exist?  The motivation for the question is that minor changes had to be made to the GrokAsaParser to get unit tests (and possibly the parser itself working).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] metron issue #612: METRON-962: Configuration Based Unit Tests and Add integr...

Posted by justinleet <gi...@git.apache.org>.
Github user justinleet commented on the issue:

    https://github.com/apache/metron/pull/612
  
    I'm actually just going to kill GrokAsaParser.  We know BasicAsaParser is used.  GrokAsaParser seems a bit questionable based on code changes and restructuring we've done, is less adaptable, and nobody has ever mentioned it.  If someone feels that we need to keep it, let me know and I'll revert and deprecate it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] metron pull request #612: METRON-962: Configuration Based Unit Tests and Add...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/metron/pull/612


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] metron issue #612: METRON-962: Configuration Based Unit Tests and Add integr...

Posted by cestella <gi...@git.apache.org>.
Github user cestella commented on the issue:

    https://github.com/apache/metron/pull/612
  
    +1 by inspection.   This is good work; we inherited a lot of these from the initial opensoc import, so normalizing and reducing the dead weight is a valuable contribution.  Thanks @justinleet 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---