0.0.27 • Published 1 year ago

@jolie/jot v0.0.27

Weekly downloads
-
License
LGPLv2.1
Repository
-
Last release
1 year ago

jot - Jolie testing suite

jot logo

jot is a command-line tool for testing Microservice Architectures(MSAs). The tool is developed using Jolie, a service oriented programming language that empathize the structured linguistic approach to the programming of services.

jot provides a Jolie developer ability to develop a service that will act as a tester service in the project. With the concept of tester service, it can also be used to test any services with the protocol that Jolie supports.

Installing

Using npm:

# install in a project
npm install @jolie/jot

Usage

Running jot

Provide a field in package.json script to invoke jot through npm run

  "scripts": {
    "test": "jot [jot_configuration.json]"
  },

then you can invoke jot using npm run test

npm run test

jot Configuration file

jot requires the user to provide detail for testing service in json format.

{
  "test": "test", // path to test directory. Default: "test"
  "params": { // parameter for jot, key of this object defines the Jolie service that jot will launch
    "service.ol": [ 
      {
        "name": "main", // name of the service
        "params": { } // parameter to pass to the `main` service that reside in TestJot.ol
      }
    ]
  },
  "reporters": { // [OPTIONAL] reporter configuration
    "path": "", // path to custom reporter module
    "service": "" // reporter service
  }
}

See examples folder for basic usage in practice.

Annotation

Currently, jot supports 5 annotations for describing the test cycle between test service, namely @BeforeAll, @BeforeEach, @Test, @AfterEach, @AfterAll.

The operation invocation inside testing service The life cycle for each service operation invocation is following, from top to bottom.

@BeforeAll
    |
@BeforeEach
    |
  @Test
    |
@AfterEach
    |
@AfterAll

Note that the execution order for each operation is non-deterministic.

Customize Reporter

jot provides an ability to customize the test runner by providing a set of operations that a user may use to change the result to show on console. The default reporter is shown in spec.ol

type Service {
    title: string // test service name
}

type Test {
    title: string // test operation name
}

type TestFailed {
    title: string // test operation name
    error: any // error message
}


/**
	metrics data collected by the test runner
*/
type Stats {
	tests: int
	passes: int
	failures: int
	services: int
	durations: long
}

/**
    interface that jot will use to communicate with the reporter
 */
interface ReporterInterface {
	RequestResponse: 
        // fires when the test runner finished it's instantiation
        eventRunBegin(void)(void),

        // fires when the test operation pass
        eventTestPass(Test)(void),

        // fires when the test operation fail
        eventTestFail(TestFailed)(void),

        // fires when a testing service finished it's instantiation
        eventServiceBegin(Service)(void),

        // fires when a testing service completes all the testing operations
        eventServiceEnd(Stats)(void),

        // fires when the test runner complete all the testing services
        eventRunEnd(void)(void)
}
0.0.26

1 year ago

0.0.27

1 year ago

0.0.25

2 years ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.13

3 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago