#16 Run python3-test in standard test interface
Closed 5 years ago by churchyard. Opened 6 years ago by lzachar.
https://pagure.io/lzachar-p3-tests.git master  into  master

Run python3-test in standard test interface
Lukas Zachar • 6 years ago  
tests/tests.yml
file added
+22
@@ -0,0 +1,22 @@

+ ---

+ - hosts: localhost

+   vars:

+     - artifacts: ./artifacts

+     - subjects:

+       - python3-test

+   tags:

+     - classic

+     - container

+   roles:

+   - role: standard-test-rpm

+   tasks:

+     - name: Run bundled tests

+       block:

+         - name: Execute tests

+           shell: python3 -m test.regrtest  -wW &> /tmp/python3-tests.log

+       always:

+         - name: Pull out the artifacts

+           fetch:

+             dest: "{{ artifacts }}/"

+             src: "/tmp/python3-tests.log"

+             flat: yes

no initial comment

Adds test suitable for Fedora CI [1].
Executes all tests from python3-test package (unittests included in
cpython). Although they were run during the %check phases of rpm build,
since build system and "real" system differ, we aim to detect issues
not present in the build system.

For execution see the wiki ([1]) or previous PR [2].

Please review and find all wrongs in this PR.

[1] https://fedoraproject.org/wiki/CI
[2] https://src.fedoraproject.org/rpms/python3/pull-request/14

That's much more reasonable. Running the tests on the installed software does bring a benefit over testing from builddir, which we currently do in %check.

Please add the -wW flags to regrtest.

If I'm expected to maintain these tests, I'd welcome a standard way to run the tests "like in mock" – locally, but reasonably isolated from the rest of my machine, and in an environment similar to a specific Fedora. The wiki lists a lot of different ways to do different things, and makes me feel lost.

The instructions from the previous PR don't work: ansible complains about missing file /usr/share/ansible/inventory, which is not in Fedora repos.
The test does run with:

$ sudo dnf install ansible python2-dnf libselinux-python standard-test-roles
$ sudo ansible-playbook tests.yml

but that seems to run directly on my machine.

For running tests locally you could try:
https://github.com/thrix/upstream-testing-vagrant/
That should run tests locally in VM.

As you pointed you need to install standard-test-roles, which fills /usr/share/ansible/inventory with own roles.
I ran it as

$ sudo ANSIBLE_INVENTORY=$(test -e inventory && echo inventory || echo /usr/share/ansible/inventory) TEST_DEBUG=1 TEST_SUBJECTS=docker:docker.io/library/fedora:26 TEST_ARTIFACTS=$PWD/artifacts ansible-playbook --tags container tests.yml -vvv

I'll update the test later today

1 new commit added

  • run tests as -wW
6 years ago

rebased onto 7b52eab

6 years ago

It was established IRL that we'll do this a bit differently in cooperation.

Pull-Request has been closed by churchyard

5 years ago
Metadata