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

@icyphy/github-issue-junit

v0.1.7

Published

Read JUnit HTML output and add a comment to an open issue on GitHub.

Downloads

1

Readme

Based on https://github.com/vitalets/github-trending-repos/ and a suggestion by @nebgnahz.

Read JUnit HTML output and add a comment to an open issue on GitHub.

This module hacks around the problem of running a Travis-CI job and wanting to notify users of failed tests.

This is a start on solving Handle Ant's JUnit XML formatted output from test/spec runs.

See https://github.com/icyphy/ptII-test/issues/1 for sample output.

To Do

  1. The contents of the JUnit html output file overview-summary.html is being parsed, which seems fragile.
  2. It might be good to list the tests that have failed.
  3. It might be good to notice if new tests have failed.

How to use

  1. Set up your Travis-ci job to run JUnit tests, save the output as xml and upload the test results to GitHub pages. See ptII/.travis.yml and ptII/bin/ptIITravisBuild.sh.

  2. In the gh-pages branch, run the ant junitreport target in frames format. See build.xml. The main thing is to create the JUnit HTML summary page at an accessible location.

  3. Create an issue in your GitHub repo that will be the issue that gets updated with the test results. See https://github.com/icyphy/ptII-test/issues/1

  4. Create a label for the issue that signifies that it will be updated, for example junit-results.

  5. Add the URL of the JUnit summary results page created by running the ant junitresults target, for example https://icyphy.github.io/ptII-test/reports/junit/html/overview-summary.html. This tool looks for issues with a specific label and searches for urls that matches a regular expression defined in scripts/config.js. So the issues need to ahve the appropriate label and the appropriate URL.

  6. In your environment, set the JUNIT_LABEL variable to the name of the label created above

export JUNIT_LABEL=junit-results
  1. In your environment, set GITHUB_ISSUE_JUNIT to the API URL of the repo containing the JUnit output:
export GITHUB_ISSUE_JUNIT=https://api.github.com/repos/icyphy/ptII-test
  1. Edit the regular expressions in scripts/helpers/issues.js. (FIXME: These should be environment varialbles)

  2. To update an issue from Travis-ci, get a GitHub token

  3. On GitHub, under your account on the upper right, click on Settings -> Developer Settings -> Personal access tokens -> Generate new token

  4. The new token should have public_repo status

  5. On Travis-ci, on your project page, click on More options -> Settings, then add the token from the step above as GITHUB_TOKEN

  6. For testing purposes, set the GITHUB_TOKEN environment variable on your local machine

  7. If necessary, update any other variables in scripts/config.js

  8. To test:

node ./scripts/junit-results.jso
  1. To actually upload the results to an issue:
export JUNIT_RESULTS_NOT_DRY_RUN=false
node ./scripts/junit-results.js
  1. To have Travis do the update, create a script:
#!/bin/bash

mkdir node_modules
npm install @icyphy/github-issue-junit
export JUNIT_LABEL=junit-results
export JUNIT_RESULTS_NOT_DRY_RUN=false
export GITHUB_ISSUE_JUNIT=https://api.github.com/repos/cxbrooks/travis-junit
(cd node_modules/@icyphy/github-issue-junit/scripts; node junit-results.js)

How to clean results that are older than 30 days

  1. Follow steps 1 - 7 above

  2. To test

node ./scripts/issue-cleaner.js
  1. To actually upload the results to an issue:
export JUNIT_RESULTS_NOT_DRY_RUN=false
node ./scripts/issue-cleaner.js

How to publish updates to this module

  1. Update the patch number in package.json

  2. Login to npm npm login

    Username: icyphy-npm
    Password: See https://wiki.eecs.berkeley.edu/ptolemy/Ptolemy/Accounts or passwords/icyphy-npm in the  https://repo.eecs.berkeley.edu/git/projects/ealprivi/ealprivi.git repo.
    Email: [email protected]
  3. Publish: npm publish --access public