From Fedora Project Wiki

< CI

No edit summary
Line 1: Line 1:
===Preconditions===
==='''Preconditions'''===
To start working with a test you need Fedora installed on your PC or VM.
To start working with a test you need Fedora installed on your PC or VM.


Line 14: Line 14:
# dnf install ansible python2-dnf libselinux-python standard-test-roles
# dnf install ansible python2-dnf libselinux-python standard-test-roles
</pre>
</pre>
 
<br/>
===Get tests===
==='''Get tests'''===
Navigate to the https://upstreamfirst.fedorainfracloud.org/ and choose any package you like to run.<br />
Navigate to the https://upstreamfirst.fedorainfracloud.org/ and choose any package you like to run.<br />


Line 39: Line 39:
[[File:Selection 002.png|frame|left|List of tags]]  
[[File:Selection 002.png|frame|left|List of tags]]  
<br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/>
It means that we have <code>container, atomic, classic</code>  tags
It means that we have <code>container, atomic, classic</code>  tags
So we can run our tests for each of them.
So we can run our tests for each of them.
<br/>


===Run classic (local) tests===
==='''Run classic (local) tests'''===
Now we are ready for running tests on our laptop.
Now we are ready for running tests on our laptop.
Execute command:
Execute command:
Line 54: Line 55:
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>


===Run Container (docker) tests===
==='''Run Container (docker) tests'''===
To run tests in Docker container we need to export environment variables in the first place:
To run tests in Docker container we need to export environment variables in the first place:



Revision as of 10:41, 27 November 2017

Preconditions

To start working with a test you need Fedora installed on your PC or VM.

Change user to root:

$ sudo -s

Install necessary packages:

# dnf install git
# dnf install ansible python2-dnf libselinux-python standard-test-roles


Get tests

Navigate to the https://upstreamfirst.fedorainfracloud.org/ and choose any package you like to run.

For example elfutils

Navigate to the page with tests: https://upstreamfirst.fedorainfracloud.org/elfutils

Copy Source GIT URL

Source GIT URL

Navigate to you VM or laptop command line and clone this package:

# git clone https://upstreamfirst.fedorainfracloud.org/elfutils.git
# cd elfutils

Check tags that you have. Execute command:

# ansible-playbook --list-tags tests.yml

The output will be something like tis:

List of tags















It means that we have container, atomic, classic tags So we can run our tests for each of them.

Run classic (local) tests

Now we are ready for running tests on our laptop. Execute command:

# ansible-playbook --tags=classic tests.yml

This command will run all package's tests. And the result will be:

Classic tests result























Run Container (docker) tests

To run tests in Docker container we need to export environment variables in the first place:

# export ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory)
# export TEST_SUBJECTS=docker:docker.io/library/fedora:26

Let's chack that all variables were setup:

Environment variables


Now we are ready for running tests in Docker container. Execute command:

# ansible-playbook --tags=container tests.yml

This command will run all tests in Docker container. And the result will be: