Enable CI

This commit is contained in:
Takao Fujiwara 2021-05-01 12:15:57 +09:00
parent a4e422a519
commit b7722a81bc
3 changed files with 70 additions and 1 deletions

View File

@ -3,7 +3,7 @@
Name: python-%{pypi_name} Name: python-%{pypi_name}
Version: 1.1.0 Version: 1.1.0
Release: 8%{?dist} Release: 9%{?dist}
Summary: A tiny test runner that outputs TAP results to standard output Summary: A tiny test runner that outputs TAP results to standard output
License: MIT License: MIT
@ -49,6 +49,9 @@ find %{buildroot}/%{python3_sitelib} -name '*.py' | xargs sed -i '/^#!/d'
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info %{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
%changelog %changelog
* Sat May 01 2021 Takao Fujiwara <tfujiwar@redhat.com> - 1.1.0-9
- Enable CI
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-8 * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

53
tests/tests.py Executable file
View File

@ -0,0 +1,53 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import unittest
# Need to flush the output against Gtk.main()
def printflush(sentence):
try:
print(sentence, flush=True)
except IOError:
pass
def printerr(sentence):
try:
print(sentence, flush=True, file=sys.stderr)
except IOError:
pass
from pycotap import TAPTestRunner
from pycotap import LogMode
printflush('## Load pycotap')
class AnthyTest(unittest.TestCase):
__test_index = 0
@classmethod
def setUpClass(cls):
printflush('## setUpclass done')
cls.__test_index += 1
def setUp(self):
self.__test_index += 1
printflush('## setUp done')
def test_case1(self):
if self.__test_index != 2:
with self.subTest(i = self.__test_index):
self.fail('setUp does not run: ' + error.message)
printflush('## Test done %d' % self.__test_index)
def main():
loader = unittest.TestLoader()
# Log should be in stderr instead of StringIO
runner = TAPTestRunner(test_output_log=LogMode.LogToError)
unittest.main(testRunner=runner, testLoader=loader)
if __name__ == '__main__':
main()

13
tests/tests.yml Normal file
View File

@ -0,0 +1,13 @@
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
#- role: standard-test-beakerlib
required_packages:
- python3-pycotap
tests:
- smoke1:
dir: .
run: ./tests.py