Giter Site home page Giter Site logo

yaks-demo-apachecon's Introduction

YAKS Demo

This represents the YAKS demo for ApacheCon @Home 2020. The slides to this demo can be found here.

The demo shows how to test Apache Camel K integrations with Cloud Native BDD testing. The sample Camel K integrations use Http REST OpenAPI and Apache Kafka streaming.

Demo

The integrations are tested with YAKS BDD feature files that run inside of the Kubernetes/OpenShift cluster.

Setup

This demo assumes that you have an OpenShift cluster up and running and have access to it. Also it is assumed that you have the Camel K operator and Strimzi Kafka operator installed and ready for usage on your namespace.

Setup Kafka cluster

Once you are connected to your OpenShift namespace create a new Kafka cluster and two topics with:

$ oc apply -f infra/kafka-cluster.yaml                
$ oc apply -f infra/greetings-topic.yaml                
$ oc apply -f infra/words-topic.yaml                

Depending on your cluster domain and the namespace that you have installed the Kafka cluster to the connection URL will differ to the default that is given in the sources here. Go to the OpenShift console and find out how to connect to the Kafka brokers. You need to set this connection parameters in the Camel K sources and in the feature files before moving on to the next steps.

You can find the Camel K sources in camel-k directory

Setup Camel K integrations

The tests use Camel K integrations as SUT (System Under Test). We need to start the Camel K integrations first before running any test.

Please make sure to have the kamel CLI binary available on your machine. You can install this binary via download from the Camel K releases on gihtub.

You can run the OpenAPI greeting service and the splitter EIP as follows:

$ kamel run camel-k/GreetingService.java --resource camel-k/openapi.json
$ kamel run camel-k/greeting-splitter.groovy

This runs the greeting service that exposes the Http REST API and the splitter that listens on the greeting event stream and pushes the split result to the words topic.

You can review all components in the OpenShift console and make sure that everything is up and running. Here you can also find the service URL and the Kafka broker URL. These need to be set in the feature files before running the tests.

Setup YAKS operator

The YAKS operator is not (yet) available in the OperatorHub. So we need to install manually via the yaks CLI. You can download the yaks binary from the YAKS releases on github.

Run YAKS tests

We are finally setup and can verify the services now by running the feature files in the test directory:

$ yaks test test/greeting-service.feature
$ yaks test test/greeting-openapi.feature
$ yaks test test/greeting-outline.feature
$ yaks test test/greeting-event.feature
$ yaks test test/greeting-split-event.feature

yaks-demo-apachecon's People

Contributors

christophd avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

startupit69

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.