mizdebsk / javapackages-validator-tests

Forked from javapackages-validator-tests 2 years ago
A repositry to host tests for java packages using validator tool
Members 1
Marián Konček committed 2 years ago

javapackages-validator-tests

This repository contains files used for testing Fedora Java packages using the tool javapackages-validator and to store configuration files for that tool.

Contents

  • config/ -- Configuration files, described later.
  • test_scripts/ -- Shell scripts to be executed.
  • tests.fmf -- The main .fmf file containing metadata for all tests.

How it works

The test depends on the environment variable FMF_PACKAGE being set. This variable is the simple name of the package that is being tested.

Another environment variable, TEST_ARTIFACTS, can used to specify the path to RPMs. This allows local test execution.

The test analyzes the contents of .rpm files. The framework used by Fedora provides a standard location /var/share/test-artifacts which contains all the RPMs of the package that is being tested. It is used in common.sh.

Tests, which require javapckages-validator have to download it. This is done in common-jpv.sh. The script also compiles configuration files and sets an environment variable of the runtime classpath needed for JP-validator to work.

Configuration

The behaviour of the tests is configured in 3 places:

  1. The actual source code. We strive to keep it generic.
  2. The .fmf configuration files used in each package repository. We strive to keep them as small as possible.
  3. Most of the configuration should be done in this repository in the config directory.

Custom test configuration is handled by using standard Java interfaces. The tests refer to interfaces and the actual implementations are compiled just before testing on the host machine. Implementation is then obtained using Reflection by obtaining hardcoded instances from hardcoded classes present on the classpath.