Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@jolie/jot
Advanced tools
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.
Using npm:
# install in a project
npm install @jolie/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 filejot
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.
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.
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)
}
FAQs
Jolie Testing suit
We found that @jolie/jot demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.