Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

METRON-2257: Metron-Alerts GUI testing failing on MacOS builds #1513

Closed
wants to merge 1 commit into from

Conversation

sardell
Copy link
Contributor

@sardell sardell commented Sep 16, 2019

Contributor Comments

This PR resolves a regression introduced in the dependency upgrades in METRON-2243 (Thanks for catching this, @tigerquoll!)

I haven't quite identified the 'why' to this bug, but it looks like Cypress' update to use Electron 61 in release 3.3.0 is causing some issues with Cypress' click functionality. See the below gif, which is a recording of tests being run in Electron 61. You can see in the test side panel that the PCAP link was successfully clicked, but the route quickly changes from /pcap back to /alerts-list. The error complains about an xhr request that was never detected, probably because we weren't on the pcap page long enough to fire the request. The failures are random and differ from test run to test run, but in every video I captured the cause shows to stem from the route never changing after clicking the PCAP link.

cypress-failure

I reverted Cypress to release 3.2.0, which unfortunately introduces a high-vulnerability nested dependency. I created an issue in the Cypress repository. Hopefully we can get this resolved quickly.

New Security Vulnerability

With this dependency downgrade comes a nested dependency (lodash) that contains a high-severity security vulnerability. However, as the maintainers of Cypress have pointed out, it isn't susceptible to this security issue since it's locally run software.

Obviously, this is not ideal and will probably be flagged with a security audit. However, this is the only way to resolve this issue for now. While it is possible that I could edit the package-lock.json file, doing so is not ideal because it can be easily overridden with a user running npm i (resolving merge conflicts comes to mind here).

Testing

NOTE: We've only detected this on macOS, so you'll need that to test.

From the root of the project, run mvn install -pl :metron-alerts. If testing on master, it will fail with random Cypress failures. If running on this branch, everything should pass as it should.

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:

  • Is there a JIRA ticket associated with this PR? If not one needs to be created at Metron Jira.
  • 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.
  • Has your PR been rebased against the latest commit within the target branch (typically master)?

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:

    mvn -q clean integration-test install && dev-utilities/build-utils/verify_licenses.sh 
    
  • n/a 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:

  • n/a 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
    mvn site
    
  • n/a 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.

@tigerquoll
Copy link
Contributor

tigerquoll commented Sep 16, 2019

+1 (non binding) Tests run ok now

@mmiklavc
Copy link
Contributor

+1 Tests run ok now

Not a big deal bc this is still a draft PR, but contributors should mention "(non-binding)" for added clarity when a +1 is given by a non-committer

@mmiklavc
Copy link
Contributor

+1. I also ran this up locally. Thanks @sardell for the contribution and thanks @tigerquoll for the feedback and review contribution on this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants