You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metron.apache.org by iraghumitra <gi...@git.apache.org> on 2017/04/12 09:38:04 UTC

[GitHub] incubator-metron pull request #526: Metron-846: Add E2E tests for metron man...

GitHub user iraghumitra opened a pull request:

    https://github.com/apache/incubator-metron/pull/526

    Metron-846: Add E2E tests for metron management ui ( Do not merge )

    ## Contributor Comments
    This PR adds e2e test support for management ui. We have few e2e tests in management ui but they do not work on quick-dev-platform. The PR makes significant changes to the existing e2e code so I would request to review the entire e2e tests in total.
    
    - The e2e tests are written to run on quick-dev-platform
    - Prerequisites for running e2e test are documented in metron-config README
    - Steps to run the e2e tests are documented in metron-config README 
    
    
    ## Pull Request Checklist
    
    Thank you for submitting a contribution to Apache Metron (Incubating).  
    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?
    - [x] 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?
    - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [x] 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:
    - [x] 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`:
    
      ```
      cd site-book
      bin/generate-md.sh
      mvn site:site
      ```
    
    #### 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 recommened 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/iraghumitra/incubator-metron METRON-846

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

    https://github.com/apache/incubator-metron/pull/526.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 #526
    
----
commit b7d310ede8785f411c9a4518207dfa3ef77983b3
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-10-19T15:24:52Z

    Initial implementation of REST service

commit 77e79aba34e992c951ee804d918aea1e70b638ec
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-10-19T15:31:18Z

    added newline at the end of application.yml

commit b042dfdce8e12bf320ff5dcd7b46edf68c66a302
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-10-24T16:07:21Z

    Added logging configuration and fixed SLF4J warnings.

commit 2012369e3094dcc0d15365b914005d035e938824
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-11-18T23:11:40Z

    Metron Docker implementation

commit d9ea03eeafb6971390899c93bad73ee00216b3f6
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-11-18T23:19:13Z

    Cleaned up comments and added newlines to the end of files

commit b73e8084ba6c9299227bea8085d34731dabcdd88
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-11-21T17:34:14Z

    Merge branch 'METRON-503' into middleware

commit 072f3ec7e856acdd6d565ce0c69b52fc038ec352
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-11-28T22:18:45Z

    Merge remote-tracking branch 'mirror/master' into middleware

commit d4ff4703fcc9c84f646bf00653af43a74df3fe9d
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-11-29T13:52:24Z

    Initial middleware commit

commit c87474befc2564040d14324926efac8485a751cb
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-11-29T23:12:18Z

    Initial metron-config UI commit

commit 50b4cf4aeb5a084d43a2c70d9a364dc81b7c3a42
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-11-30T18:38:10Z

    Added start script and fixed Maven issues

commit ba70d7f851978a7aee7cab09a94ac0108b70d29f
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-11-30T18:38:45Z

    Merge branch 'middleware' into webapp

commit ecddc0b47b2a15738e42040b9154905f170a513e
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-11-30T19:06:42Z

    Moved to separate metron-config project.

commit d79977bac43c30f0434e54f089d1be1c1c91d306
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-01T20:57:06Z

    Added install and start scripts.  Now serving UI from Spring appplication server.

commit e5c3b3b25b6958b4bcd22c09cf1e4ac9333bcae9
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-02T00:02:15Z

    User feedback bug fixes

commit 46d0ff32c5317f5a6c55363cac0e948893bbf755
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-02T00:02:37Z

    Fixed pattern label bug

commit cd61e7d9e9f59fc9fe19a378266511b534b36437
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-02T00:03:02Z

    Merge branch 'middleware' into webapp

commit 1ced51e188074bc151a1cd90993b03d13633f9d9
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-05T18:35:52Z

    Fixes to parseMessage service.  Now patternLabel defaults to sensor name only if it doesn't exist and patternLabel is not appended to grokStatement (that now happens in middleware).  Changed Stellar panel to Raw JSON.

commit 53c33409916d9bfb74bb928debbe60bba18349e6
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-05T18:47:08Z

    Fixes to parseMessage service.  Now writes temporary grok statement to local filesystem.  Also fixed some corner cases for sensorParserConfigHistoryService (history doesn't exist, deleting a history that doesn't exist, etc).  Added context path to integration tests.

commit 0a329c7ee49290d2cf31d7fed744300bf2ad2e07
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-05T18:52:01Z

    Merge remote-tracking branch 'mirror/master' into docker

commit ce11ab5bcf67b051e0bbe9356d8f733de0a1ccbf
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-05T18:52:59Z

    Merge branch 'docker' into middleware

commit a985b5ac60e9635e15ea9f79b54fdf381de1a3e6
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-05T18:54:14Z

    Merge branch 'middleware' into webapp
    
    # Conflicts:
    #	metron-interface/metron-rest/src/main/java/org/apache/metron/rest/service/SensorParserConfigHistoryService.java

commit 7db0810f76ca36b1bb9c8d98c21038175ffed117
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-06T00:00:09Z

    Resolved licensing issues

commit 8825a85bfab5eaa792ea24efb1e025c90d41664b
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-06T00:09:02Z

    Resolved licensing issues

commit 35240d267f1939b78991da1b3ff0210d45839299
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-06T00:10:17Z

    Merge branch 'docker' into middleware

commit 21300e21c99db32e2c4921f389db3bab6f6271da
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-06T00:10:54Z

    Merge branch 'middleware' into webapp

commit a7dea157fb9b02739ed9d4f5a647d97b086d4822
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-06T00:11:57Z

    Resolved licensing issues

commit d38b6265b4c0806826db6f77c7c036f6115db53e
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-06T00:12:38Z

    Resolved licensing issues

commit f1ce2d0ab740b9c67f4abe00e8e88d81b43dc8cd
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-06T00:12:54Z

    Merge branch 'docker' into middleware

commit a7b9e7e96aa339e922ec6d2098eeee563f726ced
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-06T00:13:32Z

    Merge branch 'middleware' into webapp
    
    # Conflicts:
    #	pom.xml

commit f7bf12e12c979f541b4ac16174db39d1bf739bae
Author: rmerriman <rm...@hortonworks.com>
Date:   2016-12-06T00:15:28Z

    Resolved licensing issues

----


---
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] incubator-metron issue #526: Metron-846: Add E2E tests for metron management...

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

    https://github.com/apache/incubator-metron/pull/526
  
    I am not able to get this to run.  Here are the steps I followed:
    - Deploy and start the REST app on node1:8082
    - Run "npm install" in metron-config
    - Start the UI with ./scripts/start_dev_quickdev.sh http://node1:8082 (verified UI works)
    - Run the e2e tests with "npm run e2e-all"
    
    This is the error I get:
    `Using standard to parse output
    Re-running tests: test attempt 3
    
    Tests failed but no specs were found. All specs will be run again.
    
    [09:33:53] I/direct - Using ChromeDriver directly...
    [09:33:53] I/launcher - Running 1 instances of WebDriver
    Spec started
    [09:34:06] E/launcher - unknown error: cannot get automation extension
    from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
      (Session info: chrome=57.0.2987.133)
      (Driver info: chromedriver=2.26.436421 (6c1a3ab469ad86fd49c8d97ede4a6b96a49ca5f6),platform=Mac OS X 10.11.6 x86_64)
    [09:34:06] E/launcher - WebDriverError: unknown error: cannot get automation extension
    from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
      (Session info: chrome=57.0.2987.133)
      (Driver info: chromedriver=2.26.436421 (6c1a3ab469ad86fd49c8d97ede4a6b96a49ca5f6),platform=Mac OS X 10.11.6 x86_64)
        at WebDriverError (/Users/rmerriman/Projects/Metron/code/forks/merrimanr/incubator-metron/metron-interface/metron-config/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
        at Object.checkLegacyResponse (/Users/rmerriman/Projects/Metron/code/forks/merrimanr/incubator-metron/metron-interface/metron-config/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:639:15)
        at parseHttpResponse (/Users/rmerriman/Projects/Metron/code/forks/merrimanr/incubator-metron/metron-interface/metron-config/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:538:13)
        at client_.send.then.response (/Users/rmerriman/Projects/Metron/code/forks/merrimanr/incubator-metron/metron-interface/metron-config/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:472:11)
        at ManagedPromise.invokeCallback_ (/Users/rmerriman/Projects/Metron/code/forks/merrimanr/incubator-metron/metron-interface/metron-config/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1379:14)
        at TaskQueue.execute_ (/Users/rmerriman/Projects/Metron/code/forks/merrimanr/incubator-metron/metron-interface/metron-config/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2913:14)
        at TaskQueue.executeNext_ (/Users/rmerriman/Projects/Metron/code/forks/merrimanr/incubator-metron/metron-interface/metron-config/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2896:21)
        at asyncRun (/Users/rmerriman/Projects/Metron/code/forks/merrimanr/incubator-metron/metron-interface/metron-config/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2820:25)
        at /Users/rmerriman/Projects/Metron/code/forks/merrimanr/incubator-metron/metron-interface/metron-config/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:639:7
        at process._tickCallback (internal/process/next_tick.js:109:7)
    From: Task: WebDriver.manage().window().setSize(2560, 1370)`


---
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] incubator-metron issue #526: Metron-846: Add E2E tests for metron management...

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

    https://github.com/apache/incubator-metron/pull/526
  
    Also, the commit history looks strange in this PR.  Any idea why?  Did you start this branch from master?


---
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] incubator-metron issue #526: Metron-846: Add E2E tests for metron management...

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

    https://github.com/apache/incubator-metron/pull/526
  
    I removed usage of WebDriver.manage().window().setSize. It is a best practice to maximize the window before running the test cases probably we need to hold back on this practice till we upgrade to next version of angular-cli.


---
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] incubator-metron issue #526: Metron-846: Add E2E tests for metron management...

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

    https://github.com/apache/incubator-metron/pull/526
  
    I am now able to get this to run and all tests passed.  Really great work so far.
    
    I have a couple of requests.  First there are some very minor style issues.  Several lines are not terminated so that should be cleaned up.  
    
    I feel like the organization of the "Sensor Config for parser e2e1" is too broad.  I would prefer tests to be broken down a little bit more, by feature or editor pane if possible.  For example, as a test I swapped the sort orders in threat triage editor.  The tests failed (yay!) but the test description reported in the failure was "Sensor Config for parser e2e1 should add e2e parser".  That is too vague and gives me no indication of where the error happened and what part of the code I need to inspect. 
    
    I think there may also be some gaps in testing.  Is the raw JSON editor tested?  Advanced config?  Are we testing how we format field names and values in the read-only and list view?  When we're editing sensors are we verifying the correct config is saved?  Are we verifying the editor looks correct when we open an existing sensor (not just the primary form but child panes as well)?  Are we testing the general settings page?
    
    Another concern I have is that we're expecting a static list of sensors.  These tests will break if a sensor is ever added to Metron and it won't be obvious because these tests are not part of the build workflow.  Is it possible/reasonable to add some kind of setup script to create the test cases so that they will not be affected by new parsers being added?
    
    Still more work to do but this is a solid start.


---
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] incubator-metron issue #526: Metron-846: Add E2E tests for metron management...

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

    https://github.com/apache/incubator-metron/pull/526
  
    Looks like you are running into this [issue](http://www.kenst.com/2015/03/installing-chromedriver-on-mac-osx/). The only way as of now is either not using WebDriver.manage().window().setSize method or upgrading chrome web driver manually. I will check and update what could be the best way for us.
    
    As for commit history, looks like git smartly picked commit history when I merged code my changes from 623 branch to master. I can resubmit the PR on a fresh branch if this looks awkward :)


---
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.
---