Coder Social home page Coder Social logo

pombredanne / check_modulemd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fedora-modularity/check_modulemd

0.0 1.0 0.0 171 KB

check modulemd file using avocado framework based test

License: GNU General Public License v3.0

Python 93.59% Shell 3.85% Makefile 2.57%

check_modulemd's Introduction

check_modulemd

This contains avocado testing framework based tests to conduct various module checks.

  • check_modulemd.py - check the validity of a modulemd file

Setup

Install prerequisite RPMs if necessary:

  • pdc-client
  • python2-aexpect - dependency for python-avocado
  • python2-avocado - avocado testing framework
  • python2-avocado-plugins-varianter-yaml-to-mux - parse YAML file into variants (Required for avocado-51.0 or later)
  • python2-modulemd - Module metadata manipulation library
  • python2-requests - HTTP library
  • python-enchant - spell checker library
  • hunspell-en-US - English dictionary
  • modularity-testing-framework - MTF support (read modulemd files from config)

e.g.

dnf install -y python2-aexpect \
python2-avocado python2-avocado-plugins-varianter-yaml-to-mux \
python2-modulemd python2-requests python-enchant \
hunspell-en-US python2-pdc-client \
modularity-testing-framework python2-dnf

Running check_modulemd.py

Call avocado to run check_modulemd.py, providing the path to the modulemd file using avocado's parameter passing mechanism:

avocado run ./check_modulemd.py --mux-inject 'run:modulemd:/path/to/modulemd.yaml'

In order to use a custom list of packaging jargon in the spell-checker, an optional additional parameter may be passed. This can be done by also providing the path to the jargon file on the command line:

avocado run ./check_modulemd.py --mux-inject 'run:modulemd:/path/to/modulemd.yaml' 'run:jargonfile:/path/to/jargon.txt'

or by providing both the modulemd and jargonfile parameters using a multiplexer yaml file like the one used in this example:

avocado run ./check_modulemd.py -m examples-testdata/params-checkmmd.yaml

For convenience during development of the test script, a wrapper script is provided that simplifies passing the required parameter:

./run-checkmmd.sh [--debug] /path/to/modulemd.yaml

You can run project also as part of Modularity Testing Framework. It will read modulemd files from config file and and can be scheduled as one of tests. Jargon file can be passed via env variable JARGONFILE=/path/to/jargon.txt or as multiplex value

 avocado run ./check_modulemd.py

You can also use provided Dockerfile:

docker build --tag=$USER/check-modulemd .

And use it:

docker run -ti -v $PWD/$MODULE.yaml:/$MODULE.yaml $USER/check-modulemd

Example modulemd files

Some example modulemd files can be obtained from the following locations:

Taskotron

This check is executed by Taskotron, see results.

Running locally

You can run the same locally by running the ansible playbook. Execute the following command as root (don't do this on a production machine!):

$ ansible-playbook tests.yml -e taskotron_item=<distgit_id>

and replace <distgit_id> with value in the form of namespace/name#gitref.

For example:

$ ansible-playbook tests.yml -e taskotron_item=modules/perl-bootstrap#cb3ea78913715df3e5b44e91ec2e464a61be918d

You can see the results in ./artifacts/ directory.

Alternatively you can run the task through Taskotron runner:

$ runtask --item <distgit_id> --type dist_git_commit check_modulemd/

Don't forget to use --ssh or --libvirt, otherwise you need to run this as root (not recommended). See Taskotron documentation.

check_modulemd's People

Contributors

bgoncalv avatar jscotka avatar karstenhopp avatar kparal avatar mmathesius avatar phracek avatar ralphbean avatar rasibley avatar submachine avatar tomastomecek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.