====== Quality Assurance Tools ====== Evergreen contributors use several tools to make sure that they are not introducing new bugs and that their contributions will be readable and maintainable in the long term. This page provides an overview of the various testing tools, what they do, and at which stage you would use them, with an emphasis on which ones you run vs which ones you write. ===== Existing automated checks and when to run them ===== ==== When changing Angular ==== === Run the Angular Unit Tests === Running the Angular Unit Tests requires a running non-production Evergreen system. If you don't have one already, [[newdevs:testserver|here's how to create a development/qa environment]]. You should run these at least twice: before and after you have made your Angular changes. - Install Firefox and/or Chrome on the system - In a terminal, ''cd'' to the Evergreen source code root (can be the git repository or a decompressed tarball) - ''cd Open-ILS/src/eg2'' - ''npm install'' - ''npm run test'' === Run the Angular Linter === You can run the angular linter with or without a running Evergreen system. [[dev:angular_dev_best_practices#ng_lint|Full information about the angular linter can be found here]]. You should run this before submitting your Angular changes for community review. - In a terminal, ''cd'' to the Evergreen source code root (can be the git repository or a decompressed tarball) - ''cd Open-ILS/src/eg2'' - ''npm install'' - ''npm run test'' === Run the Angular end-to-end nightwatch tests === These tests can take some time to run, since they fire up a browser and click around the interface as a user would. They require a running non-production Evergreen system. You should run these before submitting your Angular changes for community review. - Install Firefox on the system - ''mkdir $HOME/tmp'' - In a terminal, ''cd'' to the Evergreen source code root (can be the git repository or a decompressed tarball) - ''cd Open-ILS/src/eg2'' - ''npm install'' - ''TMPDIR=$HOME/tmp MOZ_HEADLESS=1 npx nightwatch'' ==== When changing the database ==== === Run the PgTAP tests === Instructions for [[dev:contributing:qa#pgtap_database_tests|installing and running PgTAP tests]]. They require a running non-production Evergreen database. You should run these at least twice: before and after you have made your database changes. ==== When changing the Perl code ==== === Run the Perl Unit tests === These require a running OpenSRF system and for ''./configure'' and ''make'' to have been run. You should run these before submitting your Perl changes for community review. - In a terminal, ''cd'' to the Evergreen source code root (can be the git repository or a decompressed tarball) - ''make check'' === Run the Perl Live tests === These tests can take some time to run. They require a running non-production Evergreen system. You should run these before submitting your Perl changes for community review. - Load a fresh copy of the concerto data set using the ''Open-ILS/src/support-scripts/eg_db_config'' script. - In a terminal, ''cd'' to the Evergreen source code root (can be the git repository or a decompressed tarball) - ''cd Open-ILS/src/perlmods'' - ''make livecheck'' === Run the Perl author checks === - If you have not installed it yet, ''cpan Test::Pod'' - In a terminal, ''cd'' to the Evergreen source code root (can be the git repository or a decompressed tarball) - ''cd Open-ILS/src/perlmods'' - ''prove xt/author'' === Run Perl::Critic === This is not a required step. However, it can be very informative, especially if you are new to Perl. * You can copy/paste the code you're interested in into the [[http://perlcritic.com/|Perl::Critic analyzer web site]] * You can run ''perlcritic'' from the command line. ==== When changing the documentation ==== [[https://vale.sh/|Vale]] checks our documentation to make sure it matches [[evergreen-docs:dig_style_guide|our style guide]]. Vale checks have not yet been merged into Evergreen. In the meantime, you can find our community Vale configuration in a git branch linked from [[https://bugs.launchpad.net/evergreen/+bug/2076555|the vale launchpad ticket]]. ===== Writing new checks ===== * [[Writing new angular tests]] * [[Writing new pgTAP tests]] {{tag>automated-tests}}