Coder Social home page Coder Social logo

ephemerals's Introduction

Ephemerals

Build Status Maven Central

Ephemerals make it easy to setup test environment on-the-fly and let it scale with your container cluster. The main motivation behind Ephemerals is that whole test environment is launched and destroyed during test lifecycle.

Ephemerals takes care of deployment process of testing endpoints and initialization of test objects:

Ephemerals can be deployed on various cloud providers for creating use-and-throw instances of browsers, web services, databases or anything else than can expose a connection endpoint.

Prerequisites

Ephemeral objects will be deployed and launched on a container cluster using a cluster manager. Following cluster managers are currently supported:

  • Kubernetes

For this quickstart, you can create a Kubernetes cluster using following options:

  • Run a Kuberenetes cluster locally using Minikube. You can find a detailed tutorial here on how to install and use Minikube.
  • Opening an account on Google Cloud Platform (GCP). GCP and its Container Engine(GKE) use Kubernetes to manage and orchestrate containers in the cluster. Follow this tutorial to spinup your first Kubernetes cluster on GKE.

Quickstart

For this quickstart, we will create a simple Junit test which will launch a Selenium standalone server using Kubernetes and initialize a RemoteWebDriver instance . We will assume that you already have a Kubernetes cluster and it's ready to use.

First, add below Maven dependencies:

<dependency>
        <groupId>com.liveperson.ephemerals</groupId>
        <artifactId>ephemerals-core</artifactId>
        <version>1.0.0.4</version>
</dependency>
<dependency>
        <groupId>com.liveperson.ephemerals</groupId>
        <artifactId>ephemerals-module-selenium</artifactId>
        <version>1.0.0.4</version>
</dependency>
<dependency>
        <groupId>com.liveperson.ephemerals</groupId>
        <artifactId>ephemerals-provider-kubernetes</artifactId>
        <version>1.0.0.4</version>
</dependency>

Initialize FireFox Selenium ephemeral instance and set Kubernetes cluster configuration using Junit rule:

@Rule
public EphemeralResource<RemoteWebDriver> seleniumResource = new EphemeralResource(
new SeleniumEphemeral.Builder(KubernetesEphemeral.create(KUBERNETES_HOST,KUBERNETES_USERNAME,KUBERNETES_PASSWORD))
                .withDesiredCapabilities(DesiredCapabilities.firefox())
        .build());

Get RemoteWebDriver instance and do some stuff using WebDriver API:

@Test
public void test() throws IOException {

        RemoteWebDriver remoteWebDriver = seleniumResource.get();
        remoteWebDriver.get("http://yahoo.com");
        Assert.assertNotNull(remoteWebDriver.findElementById("uh-logo"));

}

For more examples, see here

Documentation

See the Wiki for documentation and examples.

Features

Tests Integration

Ephemerals can be integrated into system tests, integration and end-to-end tests to programmatically create required environment entities from developer's test code.

Plug-able Cluster Systems

Ephemerals were built to support multiple cluster management systems (Ephemeral's Deployment Providers). For example, you can switch from Kubernetes to Mesos almost transparently.

Cluster-based Scaling

Ephemerals can scale according to your servers cluster resources. The amount of parallel Ephemerals instances depends only on your cluster's nodes capacity.

Cloud Platforms Support

Ephemerals can be used with any cloud computing platform (Google Cloud, AWS, etc..), given it supports one of our Deployment Providers. A perfect use-case would be using Ephemerals with Google Cloud Platform and its GKE, which is based on Kubernetes.

Build

Maven is used as a build system. In order to produce a package, run maven command mvn clean package -DskipTests.

Tests can be executed using command mvn test.

License

MIT

ephemerals's People

Contributors

waseemh avatar yarinkos avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.