[GitHub] metron pull request #1106: METRON-1672: Add metron-alerts's UI unit tests to...

2018-07-19 Thread asfgit
Github user asfgit closed the pull request at:

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


---


[GitHub] metron pull request #1106: METRON-1672: Add metron-alerts's UI unit tests to...

2018-07-16 Thread justinleet
GitHub user justinleet opened a pull request:

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

METRON-1672: Add metron-alerts's UI unit tests to travis build process

## Contributor Comments
Couple things happen here:

- Added a mvn test goal for the metron-alert UI tests
- Made the tests use Chrome headless in order to actually have them run 
properly in Travis. Also added the Chrome add-on in Travis for this.
- Updated node/npm versions to fix some issues with running the tests.  
Matched the version to https://github.com/apache/metron/pull/1096
- The build started going over time, so I resurrected the build matrix from 
https://github.com/apache/metron/pull/854. I left out the Maven wrapper stuff.  
Given that Apache's been pretty good with Travis and other projects use this 
capability, I'm in favor of using it now that we're cramming even more in.

### Build Matrix
As stated, a build matrix was added to the Travis build.  It breaks things 
into 4 sections the same as the PR it's based on.

1. Unit Tests
2. Integration Tests
3. UI tests
4. License validation

Javadoc is skipped, because it's broken (sigh).  I have the fixes in a 
branch, and I'd like to turn it on as follow-on.

### Testing
Make sure that `mvn test` works from metron-interface/metron-alerts.  It 
should not spin up an actual Chrome window and should be headless.

If you choose to push into Travis, you should see something the following 
in the output. This can be seen at 
https://travis-ci.org/justinleet/metron/jobs/404500911. The overall build 
matrix job can be seen at 
https://travis-ci.org/justinleet/metron/builds/404500908.
```
[INFO] > metron-alerts@0.5.1 test 
/home/travis/build/justinleet/metron/metron-interface/metron-alerts
[INFO] > karma start --single-run --browsers ChromeHeadless karma.conf.js
[INFO] 
[INFO] 16 07 2018 16:01:20.477:INFO [karma]: Karma v1.4.1 server started at 
http://0.0.0.0:9876/
[INFO] 16 07 2018 16:01:20.480:INFO [launcher]: Launching browser 
ChromeHeadless with unlimited concurrency
[INFO] 16 07 2018 16:01:20.492:INFO [launcher]: Starting browser Chrome
[INFO] 16 07 2018 16:01:44.456:INFO [HeadlessChrome 0.0.0 (Linux 0.0.0)]: 
Connected on socket Ts9_772t05A32Ohr with id 78239511
[INFO] HeadlessChrome 0.0.0 (Linux 0.0.0): Executed 0 of 23 SUCCESS (0 secs 
/ 0 secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 1 of 23 SUCCESS (0 secs / 0.205 secs)
[INFO] 16 07 2018 16:01:48.411:WARN [web-server]: 404: /api/v1/global/config
[INFO] 16 07 2018 16:01:48.418:WARN [web-server]: 404: /api/v1/global/config
[INFO] e 0.0.0 (Linux 0.0.0): Executed 2 of 23 SUCCESS (0 secs / 0.41 secs)
[INFO] 16 07 2018 16:01:48.611:WARN [web-server]: 404: /api/v1/global/config
[INFO] e 0.0.0 (Linux 0.0.0): Executed 3 of 23 SUCCESS (0 secs / 0.581 secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 4 of 23 SUCCESS (0 secs / 0.738 secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 5 of 23 SUCCESS (0 secs / 0.783 secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 6 of 23 SUCCESS (0 secs / 0.853 secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 7 of 23 SUCCESS (0 secs / 0.884 secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 8 of 23 SUCCESS (0 secs / 0.911 secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 9 of 23 SUCCESS (0 secs / 0.936 secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 10 of 23 SUCCESS (0 secs / 0.952 
secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 11 of 23 SUCCESS (0 secs / 1.003 
secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 12 of 23 SUCCESS (0 secs / 1.039 
secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 13 of 23 SUCCESS (0 secs / 1.04 secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 14 of 23 SUCCESS (0 secs / 1.04 secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 15 of 23 SUCCESS (0 secs / 1.073 
secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 16 of 23 SUCCESS (0 secs / 1.074 
secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 17 of 23 SUCCESS (0 secs / 1.075 
secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 18 of 23 SUCCESS (0 secs / 1.1 secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 19 of 23 SUCCESS (0 secs / 1.101 
secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 20 of 23 SUCCESS (0 secs / 1.101 
secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 21 of 23 SUCCESS (0 secs / 1.101 
secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 22 of 23 SUCCESS (0 secs / 1.126 
secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 23 of 23 SUCCESS (0 secs / 1.214 
secs)
[INFO] e 0.0.0 (Linux 0.0.0): Executed 23 of 23 SUCCESS (1.249 secs / 1.214 
secs)
```

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