npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jahia/jahia-reporter

v1.2.0

Published

Testrail and ZenCrepes reporter that accepts mocha json and jest xml reports

Downloads

8,410

Readme

jahia-reporter

Using Mocha JSON or JEST/JUNIT XML as input, jahia-reporter is a CLI tool built with OCLIF to various perform actions following a test execution (send results to testrail, to slack, ...).

oclif Version Downloads/week License

Application Design

The main idea is to ingest a diverse set of test reports (Junit XML, mocha) and import those in a common data model. The data can then be manipulated/processed by various utilities to obtain a standardized, platform-agnostic output.

For example, if slack notifications are sent by Bamboo, CircleCI, GitHub Actions, ... following tests executions, all will look slightly different in their output, with different capabilities when it comes to the content of the message being sent. With Jahia-reporter, those can be standardized to one common messaging, no matter which platform the tests were executed in.

Additional data ingesters can easily be added to process test results from more sources.

Data Model

If you need to design another ingester, or another command making use of the ingested data, you can find the exact specs of the model in src/global.type.ts (interfaces pre-fixed with JR).

The model is composed of the following levels:

  • JRRun: A Jahia Reporter run, composed of multiple reports
  • JRReport: A report is composed of multiple test suites
  • JRTestsuite: A test suite is composed of multiple test cases
  • JRTestcase: A test case is composed of 0 or more failures
  • JRTestfailure: Failure in one of the test

The most important piece of analysis is JRTestcase which is an individual test that has the status PASS or FAIL depending of the presence of failures. From that point on, all metrics are bubbled-up all the way to JRRun.

Available Commands

Main commands are stored under src/commands, those commands must all make use of the data model and use test report as their primary data source. Utilities commands are available in src/commands/utils, those are performing satellite activities (such as fetching installed modules versions).

More details can be obtained about all of the commands by using --help with the command (or by looking at the source code).

Testrail

Given an existing project name, submit data to testrail. All of the missing elements (milestones, runs, cases) are automatically created if non-existing. Projects are not automatically created.

Slack

Given a Slack webhook, submit a formatted message to slack to report about test execution status.

Sample:

Test summary for: MODULE_NAME - 35 tests - 4 failures
Suite: TEST-org.jahia.test.graphql.GraphQLPublicationTest.xml - 6 tests - 4 failures
 |-- shouldPublishNoSubtree(org.jahia.test.graphql.GraphQLPublicationTest) (5s) - 2 failures 
 |-- shouldGetErrorNotRetrieveAggregatedPublicationInfoFromLive(org.jahia.test.graphql.GraphQLPublicationTest) (3s) - 2 failures 

Various parameters are available to customize the message (notification icon, ...), notify particular individuals, ...

ZenCrepes

Given a ZenCrepes webhook, sends the outcome of a test run to ZenCrepes with the objective of building a test matrix of all latest runs for all possible combinations (Augmented Search 2.1.0, tested on 2020-08-10, with Jahia 8.0.1.0 and Elasticsearch 7.8.0).

Utils

modules

Given a Jahia host (and credentials), fetches the Jahia version (and build number) and version of all modules and save this results in a JSON file. Data model used is detailed here: src/global.type.ts

This file can then be used as input for other Jahia-Repoter first-level commands.

Development

To add a new command, simply create the corresponding .ts file in the ./src/commands/ folder.

yarn
./bin/run yourcommand --help

If adding a utility, please add this into the utils folder

Release

CI/CD on this repository is performed with GitHub actions, publication to NPM and building of the docker images can be done by creating a release in GitHub(with three digit versioning).

Usage

With NPM

npm install -g @jahia/jahia-reporter@latest
jahia-reporter testrail --help

With Docker

docker run jahia/jahia-reporter:latest jahia-reporter slack --help

Since the tool takes actual files as primary input, it is necessary to make them available to the tool during the run, this can be done by mounting the volume like this:

docker run --rm -v $PWD/junit/json2:/root/:ro jahia/jahia-reporter:latest /bin/bash -c "jahia-reporter slack /root/ WEBHOOK_URL -t json -u http://www.circleci.com -n \<@SLACK_USERNAME\> -w jahia -m augmented-search"