Coder Social home page Coder Social logo

demo's Introduction

Demo - demonstrates an application and tests

This is an application used by Coveros to demonstrate a multitude of good software practices.

Dependencies:

Quick Start:

Optional Dependencies - needed for API testing and Selenium testing.

Java notes

It has to be Java 8. Specifically, Mockito and Checker Framework are reliant on the system using Java 8. Mockito issue and Checker Framework issue

Chromedriver notes

make sure that the Chromedriver executable is installed in one of the directories that is on your path. To see your path, type the following in a command line:

on Windows:

echo %PATH%  

On Mac/Linux:

echo $PATH

Python notes

To run API tests and Selenium tests, an easy way to handle its dependencies is to use pipenv. To get this installed, first download get-pip.py, and run the following on the command line:

python get-pip.py

Then,

pip install pipenv

And in the demo directory,

pipenv install   

To build and run tests:

On the command line, run the following:

On Mac/Linux

./gradlew check

On Windows

gradlew check

To run the web application:

On the command line, run the following:

On Mac/Linux

./gradlew appRun

On Windows

gradlew appRun

Then, head to http://localhost:8080/demo

To run API and UI tests:

Note: The app has to be already running for these tests to pass, and you need to have installed Python and Chromedriver.

On the command line, run the following:

On Mac/Linux

./gradlew runAllTests

On Windows

gradlew runAllTests    

Interesting links when the system is up:

Summary of relevant Gradle commands

  • gradlew appRun - runs the application

  • gradlew check - runs all tests possible with only dependency being Java 8. No need for app to be running.

  • gradlew runAllTests - runs the whole set of tests**

  • gradlew clean - cleans build products and installs pre-push hook. (see the file in this directory, pre-push)

  • gradlew runBehaveTests - runs the UI tests**

  • gradlew runApiTests - runs the API tests**

  • gradlew generateCucumberReport - runs cucumber and creates a nice-looking HTML report

  • gradlew pitest - runs mutation testing (see http://pitest.org/)

  • gradlew dependencyCheckAnalyze - analyzes security reports for the dependencies of this project. See https://www.owasp.org/index.php/OWASP_Dependency_Check

  • gradlew sonarqube - runs static analysis using SonarQube. Sonarqube must be running - check http://localhost:9000

  • gradlew fastIntegrationTest - runs the database integration tests

  • gradlew startH2Console - Starts a console to examine the H2 database file. (user and password are empty, URL to use is jdbc:h2:./build/db/training)

  • gradlew <task 1>... taskTree - a utility that will show the task tree for a particular task

    ** Requires the app to be running (usually in another terminal) and all optional dependencies installed.

Summary:

Demo consists of a simple web application and tests. Its goal is to provide an environment suitable for demonstration and practice in valuable development techniques. Some of the techniques exemplified are:

Its essential goals:

  • Just works, any platform.
  • As simple as possible
  • Minimal system requirements
  • Fast and easy to install and to run
  • High test coverage
  • Multiple business domains
  • Easy to maintain and improve
  • Well documented
  • High performance
  • Illustrates maximum number of techniques
  • Easy to get up to speed

The whole shebang - a CI/CD pipeline

Follow the directions to create a Jenkins box and a UI-testing-box, per the instructions in docs. or, see the appliance notes below.

Features of the pipeline:
  • Instructions for setting up virtual machines (with VirtualBox).
  • A fully functioning demonstration CI/CD pipeline using Jenkins.
  • Incorporates static analysis using SonarQube
  • Zap attack proxy security analysis
  • UI tests running on Chrome

Appliance

I've stored an appliance for running the pipeline here. Details for using the appliance are in the README there.


##Screenshots: Cucumber report Feature file Jenkins pipeline Webapp Zap attach proxy SonarQube analysis Running performance tests

demo's People

Contributors

7ep avatar byronka 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.