New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changes to run locally and misc fixes and/or refactoring #114
Conversation
mach6
commented
Jun 30, 2015
- Client now uses selion enhanced grid for local runs
- ios-driver 0.6.6-snapshot is gone but optional
- Client has no selenium-sever dependencies unless running locally. Server dependencies for local runs are downloaded on demand and/or configured in by user
- Misc other changes ... view commit message(s) for additional details
/** | ||
* Shutdown the launcher | ||
*/ | ||
abstract void shutdown(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
abstract
keywords are redundant in an interface. Please have them removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Sure are. Will fix
Minor observation We can remove
since all of the above 4 classes extend from On a related observation, I believe some of the discussions we were having were related to getting rid of the need for Also I believe that for starting a test locally against iOS driver (or) selendroid, we can very well just spawn the LocalIOSNode/ LocalSelendroidNode and then work with creating a RemoteWebDriver instance using it. If that is the route that we take then I believe we can very well get rid of the LocalHub and LocalNode classes for sure. |
/** | ||
* Dash argument for disabling continuous restart nature of {@link JarSpawner} | ||
*/ | ||
public static final String SELION_NOCONTINUOS_ARG = "-noContinuousRestart"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took me a min to see it, but yes, will fix it
The current implementation causes problems for the very first time when someone wants to basically run a web test locally. This scenario becomes valid especially when the user is on a very slow network and the downloading is slow. In my case
|
I feel that we may perhaps have complicated things a little bit here.
That way we don't need to bring in |
This is a bug. I introduced the ability to bypass the timestamp check in |
Letting initialization run indefinitely did not feel like the right thing to do. Thus, the initialization timeout is currently configurable via |
@mach6 Imagine the below scenario. Our user is working on an offline basis wherein he/she doesn't have an internet connection. Our current model will never let a user run his tests because it expects to download chromedriver/phantomJS driver/InternetExplorer driver etc., from the internet apart from downloading the selenium jars before he/she can run anything. What if the user is behind a corporate proxy/firewall setup which prevents downloads from the internet ? This to me is a big step in the reverse direction. IMO we should delegate the responsibility of setting up the local environment to the user (even Selenium expects the users to do this as a pre-requisite and doesn't automagically do it for them) and just run against the setup environment. Also if a user has already setup his environment (such as installing chromedriver and phantomJS driver via tools such as So for local runs we should just keep things simple by asking the user to provide us with the command to spin off a node and use that command to spin off a single sub process (ONLY for selendroid, iOS-driver and appium local runs use cases) and then have the tests run against that newly spun off sub process. For web tests involving local runs we should use |
@krmahadevan I fail to see how downloading dependencies (in the case of brew or other) which requires an internet connection and pre-work is any different -- a user can pre-establish
This change, if we decide to go this route, can come later. My intent here was to address the multiple selenium-server version conflicts, ios-driver snapshot, multiple implementations (both in client and server) for spinning up The changes I made to the "server" jar needed to happen regardless. We needed to support launching more than just a regular |
@mach6 The point I am trying to make here is that, this assumption is an overhead due to the following reasons
With respect to using other web drivers, I believe that it should be done in this itself because doing that is going to get rid of the need for a local Hub and local node completely. That means that there is no need for the changes done at the server jar to be made. The current implementation that we had (ie., a customized Grid with a plain vanilla node) itself should suffice. Launching more than just the regular node/hub and standalone is IMO not required because there is not much we are doing in the other standalones (such as appium, iOS driver, selendroid) apart from providing mechanisms for recycling a node via extra servlets. |
I see some value in having the SeLion client use our local hub and a local node. This provides the ability to have an execution environment that is "closer" to what you will get from our Grid. We can also support a direct runlocally mode where the browser driver instances are leveraged directly (from a user configurable location if necessary). This is really a new capability though and I would recommend we try to support both modes of "runlocally". |
@krmahadevan this behavior is fixed in the most recent updates / commit. Driver binaries are downloaded to and used in |
@fakrudeen78 @sebady @krmahadevan @shelar Ping.. New commits on this PR. Feedback welcome. Note: I still have pending (not yet complete) changes for the one area I see outstanding with this PR -- improving the |
I think we can remove the capability of starting the Grid locally in SeLion client which will simplify the code:
Your approach simplify the user experience, but I think right now setting-up/starting our SeLion grid is very simple. So user can easily do it. Just my thought on this... |
W.R.T to running local for web, etc. My intention and approach in this PR keeps the existing capabilities intact as much as possible. We can/should pursue other options after M5 and 1.0.0. |
b966786
to
d9c5c93
Compare
22b58b3
to
a848fd8
Compare
nodes/hubs, introduce Selion-Common, refactoring, and misc updates or fixes Client Changes ------------------- - Made Selenium-Server and Selion-Grid dependencies optional in SeLion "client" - They are only required for local runs - Removed iso-driver config values which do not apply to iso-driver 0.6.5 - Removed AbstractNode - Introduced AbstractBaseLocalServerComponent which provides base implmentations for all LocalServerComponents - Removed LocalGridConfigFileParser and test -- class no longer required - Removed localnode.json from client's src/main/resources - Changed LocalGridManager, LocalNode, LocalIOSNode, and LocalHub, and LocalSelendroidNode to use SeLion-Grid for their needs - Nodes are now started on probed ports vs. fixed ports - Chromedriver, phantoms, etc downloaded and used for local runs, when missing - Remove Hub.java hack - Upgrade TestNG, appium-client, and snakeyaml dependencies - Added guarding against ClassNotFound exception when SeLion-Grid and/or selenium-server is/are not available when running locally via SeLion client Server Changes ---------------------- - Refactoring and introduction of new launcher/spawner classes in SeLion-Grid - Added IOSDriverJarSpawner - Added SelendroidJarSpawner - Added AppiumSpawner - Added ThreadedLauncher for launching selenium hub and web nodes in the same process on a different Thread - Added shutdown() to SeLionGridLauncher - Introduced interface RunnableLauncher - Added abstract and base classes for RunnableLaunchers which are a) in the same process, b) in a separate process, and c) mobile, in a separate process - Introduced option to disable continuos restart for the RunnableLauncers which are process spawners - Introduced enumeration InstanceType which is used to track the current instance SeLion-Grid is managing and/or booting (e.g. hub, node, etc) - Added JVM shutdown hook for launcher/runners which spawn a new process -- This should help cleanup on Windows - Relocated class ArtifactDetails and reduced visibility.. it is only used by the FileDownloader - Moved several classes from depending org.apache.commons.lang3 (a transitive dependency of selenium-server -- may not be in the class path) to org.apache.commons.lang (which is available) - Updates to ConfigParser -- fixed LOGGER.entering and added ability to getJsonObject - Added ability for download.json to specify artifact "roles" -- which when considered by FileDownloader will only result in an artifact download (or "checksum" verification) if the artifact in question is required for the current InstanceType - SeLionConfg.json now allows the user to define default args for Appium, Selendroid, and ios-driver - Introduced MinimalIOSCapabilityMatcher in "server" - Add Default-Suite.xml for SeLion-Grid - FileDownloader can now skip last modified check on file AND can be told to not cleanup downloads which may have happened previously in the same JVM process - FileDownloader can now process by artifact names Other Misc Changes ---------------------------- - Addressed some Javadoc issues from misc classes - Enabled Dependency Convergence - Fix paypal#103 -- Usage of org.json - Add some test classes - Downgrade to ios-driver 0.6.5 everywhere -- many of our tests and sample code still require ios-driver 0.6.6-SNAPSHOT. 0.6.6-SNAPSHPOT can be re-intoruced by updating the SelionConfig.json for SeLion-Grid and through an pom.xml update on the user's end. - Introduction of SeLion-Common - Started to push classes which were duplicate or needed by more than one SeLion component into this new artifact - Relocated and/or renamed some classes which were pushed to common - Moved some SeLionGridConstant vars into common in new class SeLionConstants -- they are needed for both client and server and since client can run w/o server (it's an optional dependency), it made sense to do this. - Updated archetype to include SeLion-Grid and selenium-server dependencies
Also in this change set; - Update to https url for download locations - Update some tests
Also in this change set; - fix travis ci with docker containers and openjdk builds - Change behavior of webdriver dependency download -- disabled by default for LocalNode - Fix LocalNode issue when local hub started on non-default port - Add copyright to some java files which are missing it