pkiraly / qa-catalogue-web

QA Catalogue / A data quality dashboard for MARC catalogues
GNU General Public License v3.0
9 stars 7 forks source link

Add test with existing result(s) of analysis #143

Open nichtich opened 7 months ago

nichtich commented 7 months ago

Tests should automatically be run via GitHub Action and merging main to dev should require passing tests.

  1. PHP_CodeSniffer to check whether all PHP files are valid PHP code (lint rules could be very lax nevertheless)
  2. minimal test with PHPUnit (e.g. the about tab)
  3. call all tabs

First is doable without having to set up a test environment with temporary config file and Solr server to connect to. The latter would be best but can be done later.

pkiraly commented 7 months ago

We have a docker based test environment, which unfortunately was updated in July the last time, so that could be used for the "call all tabs" tests. The problem I see with PHPUnit is that the parameters that initializes the classes come from 1) URL 2) configuration 3) the JSON parameter files of the backend. It needs a preliminary investigation how they can be faked in a unit test. Any suggestion would be welcomed.

nichtich commented 1 month ago

Just linting the PHP files as done here could be a start.

nichtich commented 1 month ago

Automatically running tests has been enabled (this would have checked a bug in configuration management I just introduced) but no test actually executes the main file index.php yet.