Skip to content

Conversation

@ppisljar
Copy link
Contributor

@ppisljar ppisljar commented Aug 4, 2016

Disables angular debug info if dev mode is not enabled to increase performance of release builds

fixes #7125

@ppisljar
Copy link
Contributor Author

ppisljar commented Aug 4, 2016

i see test server sets environment name to development, so i decided to only disable debug info if environment name IS SET to production. should i rather disable debug info if environment name IS NOT SET to development ?

@epixa
Copy link
Contributor

epixa commented Aug 11, 2016

We have a dev_mode plugin in core_plugins that only runs if the app is in dev mode - can you tie into that instead of doing a dev check in ui/chrome?

We should preserve the existing logic for checking whether it's considered "development" rather than introducing a new concept (i.e. not-production). Using existing flags helps ensure this: https://github.com/elastic/kibana/blob/master/src/core_plugins/dev_mode/index.js#L2

@ppisljar
Copy link
Contributor Author

ppisljar commented Aug 11, 2016

i cant plug it in dev mode plugin, because 1) by default debug info is enabled ... we need to disable it. cant do it in dev mode plugin as it only runs in dev mode 2) actually debug info shouldn't only be enabled in dev mode but also to run test (which don't run in dev mode). that's why i used environment name (which seems to be an existing setting)

@ppisljar
Copy link
Contributor Author

ppisljar commented Aug 11, 2016

--dev does not come thru in tests ... i had to add it to the default options .... which i dont like ... but its working.

@ppisljar
Copy link
Contributor Author

jenkins, test this

@epixa
Copy link
Contributor

epixa commented Aug 12, 2016

Does this still allow us to run individual test suites? At a glance, it seems like this change would make it so you can only run tests successfully if they're all done together.

@ppisljar
Copy link
Contributor Author

no it still works as before

@epixa epixa changed the title Fix/dev mode Do not use angular debug mode unless in development Aug 19, 2016
@epixa
Copy link
Contributor

epixa commented Aug 19, 2016

This change makes it so we can't run the selenium tests against Kibana builds unless they're running in dev mode, which is definitely not ideal. This seems like a problem with our selenium tests more than anything else, but I'd rather not put the project in a state of limbo my merging this while that is the case. Can you look into what it would take to get the selenium tests to work with the angular debug mode disabled?

To reproduce what I'm talking about, just outright disable the angular debug thing rather than wrapping it in a conditional, and then run npm run test:ui.

@epixa
Copy link
Contributor

epixa commented Aug 19, 2016

Other than that, this seems like a huge win!

@ppisljar
Copy link
Contributor Author

i see ... thats weird, selenium tests should not depend on debugInfo being enabled.

10:52:45.193: self.checkForKibanaApp()
10:52:46.544: current application: undefined
10:52:46.546: kibanaLoaded = false
10:52:46.547: Kibana is not loaded, retrying

here we try to use .scope() which will return undefined if debug info is disabled. I'll check with @LeeDr what we could do about this.

but at the moment our selenium tests do seem to be running in dev mode ? it seems kibana server is started normally but when i check for internals.devFlag its set to true (so debugInfo is not disabled in current PR when selenium tests are running)

@LeeDr
Copy link

LeeDr commented Aug 22, 2016

The selenium tests don't normally run with Kibana running in dev mode. I don't think they can because of the basepath inserted in the URL. We might be able to work around that in the selenium tests if we needed to.

I don't know anything about the angular debug info. If we had to change the method in the selenium tests that checks if Kibana is loaded, we certainly could. That whole set of methods for loading pages is a bit of a mess.

@epixa
Copy link
Contributor

epixa commented Aug 22, 2016

You can run Kibana in dev mode and disable the basepath proxy, so I assume that's what's going on.

@ppisljar
Copy link
Contributor Author

ppisljar commented Aug 27, 2016

this could be merged in, but as @epixa mentioned it will prevent selenium tests from running unless they are running in dev mode ( which is currently the case ).

in the future we need to update selenium tests to not depend on angular debug info. if running selenium tests in non dev mode is a requirement then this PR needs to wait until selenium tests are updated.

@epixa
Copy link
Contributor

epixa commented Aug 29, 2016

Yeah, running selenium tests outside of dev mode is pretty important, so they should be updated to support that.

@LeeDr
Copy link

LeeDr commented Aug 29, 2016

I'm still a bit confused. I'm not sure if the current Selenium tests on Jenkins run in dev mode, but I often run the tests against a production install or release candidate on my laptop. In fact, I've made other changes just to support that better.

But if this change potentially breaks the getApp() method that uses .source() to check for Kibana, we can certainly change that (if that's the only thing that breaks).
https://github.com/elastic/kibana/blob/master/test/support/page_objects/common.js#L201

@epixa
Copy link
Contributor

epixa commented Aug 29, 2016

@LeeDr You hit the nail on the head, it seems. That function is relying on an angular debug thing that this PR is trying to remove unless you're running in dev mode because it has a negative impact on performance, so if this PR were to be merged, the tests would only be runnable in dev mode, which would be a problem.

We just need to update the page object(s) to not rely on that debug behavior.

@ppisljar
Copy link
Contributor Author

waiting for your review :)
dependency on angular debug mode in sellenium tests is removed

@LeeDr
Copy link

LeeDr commented Oct 10, 2016

@epixa I tested the changes @ppisljar made to test/support/page_objects/common.js in this PR where the dependency on angular debug mode in Selenium tests is removed.

@epixa
Copy link
Contributor

epixa commented Oct 29, 2016

jenkins, test this

@epixa
Copy link
Contributor

epixa commented Oct 29, 2016

^ I just want to see an updated selenium build with this change.

@epixa
Copy link
Contributor

epixa commented Oct 29, 2016

@ppisljar Can you rebase this to get the CI tests to run properly?

@epixa
Copy link
Contributor

epixa commented Oct 29, 2016

@ppisljar ppisljar merged commit 4755a39 into elastic:master Oct 29, 2016
elastic-jasper added a commit that referenced this pull request Oct 29, 2016
Backports PR #7929

**Commit 1:**
fix #7125 - disable angular debug info

* Original sha: b3957a9
* Authored by ppisljar <[email protected]> on 2016-08-04T08:25:47Z

**Commit 2:**
fix #7125 - disable angular debug info

* Original sha: 3972808
* Authored by ppisljar <[email protected]> on 2016-08-04T08:26:09Z

**Commit 3:**
updating to disable debug info when environment name is set to production

* Original sha: 268fdb5
* Authored by ppisljar <[email protected]> on 2016-08-04T10:02:00Z

**Commit 4:**
using --dev flag

* Original sha: d1c6ce4
* Authored by ppisljar <[email protected]> on 2016-08-11T16:26:12Z

**Commit 5:**
updating tests to not depend on angular.scope()

* Original sha: 4f83b21
* Authored by ppisljar <[email protected]> on 2016-10-03T09:39:29Z
@ppisljar ppisljar deleted the fix/devMode branch October 29, 2016 15:14
ppisljar pushed a commit that referenced this pull request Oct 29, 2016
Backports PR #7929

**Commit 1:**
fix #7125 - disable angular debug info

* Original sha: b3957a9
* Authored by ppisljar <[email protected]> on 2016-08-04T08:25:47Z

**Commit 2:**
fix #7125 - disable angular debug info

* Original sha: 3972808
* Authored by ppisljar <[email protected]> on 2016-08-04T08:26:09Z

**Commit 3:**
updating to disable debug info when environment name is set to production

* Original sha: 268fdb5
* Authored by ppisljar <[email protected]> on 2016-08-04T10:02:00Z

**Commit 4:**
using --dev flag

* Original sha: d1c6ce4
* Authored by ppisljar <[email protected]> on 2016-08-11T16:26:12Z

**Commit 5:**
updating tests to not depend on angular.scope()

* Original sha: 4f83b21
* Authored by ppisljar <[email protected]> on 2016-10-03T09:39:29Z
nreese pushed a commit to nreese/kibana that referenced this pull request Nov 10, 2016
spalger pushed a commit to spalger/kibana that referenced this pull request Nov 19, 2016
@epixa epixa added v5.1.1 and removed v5.1.0 labels Dec 8, 2016
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
Backports PR elastic#7929

**Commit 1:**
fix elastic#7125 - disable angular debug info

* Original sha: b3957a9
* Authored by ppisljar <[email protected]> on 2016-08-04T08:25:47Z

**Commit 2:**
fix elastic#7125 - disable angular debug info

* Original sha: 3972808
* Authored by ppisljar <[email protected]> on 2016-08-04T08:26:09Z

**Commit 3:**
updating to disable debug info when environment name is set to production

* Original sha: 268fdb5
* Authored by ppisljar <[email protected]> on 2016-08-04T10:02:00Z

**Commit 4:**
using --dev flag

* Original sha: d1c6ce4
* Authored by ppisljar <[email protected]> on 2016-08-11T16:26:12Z

**Commit 5:**
updating tests to not depend on angular.scope()

* Original sha: 4f83b21
* Authored by ppisljar <[email protected]> on 2016-10-03T09:39:29Z

Former-commit-id: ad43652
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable angular debug data in production build

3 participants