- 06 10月, 2017 5 次提交
-
-
由 Cleber Rosa 提交于
Pretty straightforward port, not really any remarks besides another test file becoming flexmock free. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Besides the obvious port, I reckon that using a more obvious fake return value for the return of `time.strftime` improves the legibility of the test. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
The context manager feature of mock.patch replaces a lot of the code that restores the original state. Besides that, one explicit assert was added to make sure that the non-patched state is what we expect. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
The first line says it all, this is a pretty straightforward port. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
This is a port to the mock library that is in the standard in Python 3, and it's available in Python 2, and already a requirement for Avocado. The approach used on this port is to avoid excessive mocking, and use the real code, unless when insteracting with dynamic and non-existing components (such as a remote system). A partial list of the changes when compared to the previous version: * Args was made into a real argparse.Namespace instance because there's no need for it to be a mocked object. Actually, it is better to have an exact object instance, rather than a mock when it's possible to. * The "references" attribute being set on the, then mocked, job instance has been dropped, because the natural way of passing that to the job is using the "reference" key in args. Also, while purely cosmetic, the references that look like the example instrumented tests have been renamed (passtest -> passtest.py). * The "unique_id" attribute being set on the, then mocked, job instance had a value (1-sleeptest;0) completely incompatible with job IDs, and was removed from being set manually. * This version does *not* mock "low level" remote execution of commands, such as running "env" or "avocado -v" on the remote host. Instead, it mocks the end result of check_remote_avocado completely. * The extra test on RemoteTestRunner.setup() seems unnecessary, because that is part of the run_suite() workflow. * Checking if `__init__` was called is not be possible with mock. See https://docs.python.org/3/library/unittest.mock.html#mocking-magic-methodsSigned-off-by: NCleber Rosa <crosa@redhat.com>
-
- 05 10月, 2017 3 次提交
-
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Amador Pahim 提交于
Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
由 Amador Pahim 提交于
Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
- 04 10月, 2017 13 次提交
-
-
由 Cleber Rosa 提交于
Mock is slightly lighter than MagicMock, which is only necessary when mocking "magic" methods. So, let's revert to the lighter Mock class. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
This module already uses mock, but doesn't import it in a way that is usable on Python 3. Also, let's make the style the same as in the other modules that import conditionally for Python 2 and 3. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Mock is slightly lighter than MagicMock, which is only necessary when mocking "magic" methods. So, let's revert to the lighter Mock class. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
This module already uses mock, but doesn't import it in a way that is usable on Python 3. Also, let's make the style the same as in the other modules that import conditionally for Python 2 and 3. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
six is already a stevedore requirement, but since we'll now be using it directly, it's a good idea to list it explicitly as a dependency. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Amador Pahim 提交于
Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Amador Pahim 提交于
Avocado process module has a routine to drain the std* buffer with a per-line basis loop. This loop makes the new-line character to be dropped. On the other hand, the Python logging system is hard-coded to add a new-line character at the end of the msg string. The problem takes place when `process` writes a line which originally had new-line character at the end but the logging system still adds the new-line character to that line. In this patch: - avocado.utils.process to include the new-line character in the lines that originally had one. - avocado.core.test to use for raw outputs a custom logging FileHandler that does not add a new-line character at the end of each line. Verified with (checking `.../test-results/1-.../[stdout|stderr|output]`): $ avocado run --external-runner '/bin/echo' 'foo' $ avocado run --external-runner '/bin/echo -n' 'foo' $ avocado run --external-runner '/bin/ls' '.' $ avocado run --external-runner '/bin/ls' 'nonexistingfile Reference: https://trello.com/c/dH7FLT75Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 03 10月, 2017 4 次提交
-
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Lukáš Doktor 提交于
Windows does not allow `<>:"/\|?*` characters in the filename. Let's include these in our `astring.string_to_safe_path` method and use it everywhere we create files. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
由 Lukáš Doktor 提交于
The `self.logf` is only used as output location, let's use `astring.string_to_safe_path` to make sure it can be written. As this makes sure the name is fs friendly, we don't need any hacks like `replace(" ", "_")` anymore, which also affects the html plugin. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
由 Lukáš Doktor 提交于
The html plugin uses entry-point "avocado_result_html", but the pkg name is "avocado-framework-plugin-result-html" and that is what "pkg_resources.require" accepts. This required few tweaks related to recent changes to html plugin which produces a single result file instead of multiple files. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
- 02 10月, 2017 1 次提交
-
-
由 Amador Pahim 提交于
Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
- 29 9月, 2017 1 次提交
-
-
由 Lukáš Doktor 提交于
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com> * https://github.com/avocado-framework/avocado: MANIFEST.in: there are no longer YAML files under examples
-
- 28 9月, 2017 6 次提交
-
-
由 Cleber Rosa 提交于
This fixes the warning "warning: no files found matching 'examples/*.yaml'" while running "make develop". Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
As in previous commits, job should not count on arguments being present, such as "base_logdir". This also needs to be handled when using dry run mode. Since the dry run implementation creates a temporary directory itself, it needs to be cleaned up in addition to the tmpdir created by setUp. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
One of the premises of the Job class is that it can be created without any mandatory information set in the args parameter. But, because of the way we're testing it, we always pass a base_logdir. This test is about making sure the job gets a base_logdir, and consequently a logdir, even when a base_logdir is not set in the args. The implementation of this test is based on the fact that there's already a tmpdir that can be used for playing the role of a base_logdir. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
We already handle the lack of a unique_job_id in a job, but when using dry run, the check is not being done in a way that waives that requirement. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
The Job class code uses the same name, logdir, for both the directory that will hold a given job's results (job-<timestamp>-<shortid>) and the base directory, where the first one will be created. This changes the naming so that the base log dir, only present in the job arguments (the argparse.Namespace instance) will be named "base_logdir". The job's result dir, which value is kept in the job instance itself, is still named "logdir". Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
In theory, the option will always be set when running a job with the accompanying "CLI" plugin enabled. In practice, some of the selftests create Job instances, and the "mux_debug" option may not be present. The exact error that occurs in these situations is: ERROR| Reproduced traceback from: [...]/avocado/core/dispatcher.py:255 ERROR| Traceback (most recent call last): ERROR| File "[...]/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/__init__.py", line 416, in initialize ERROR| if args.avocado_variants.debug: ERROR| AttributeError: 'Namespace' object has no attribute 'avocado_variants' ERROR| ERROR| Error running method "initialize" of plugin "yaml_to_mux": 'Namespace' object has no attribute 'avocado_variants' Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 27 9月, 2017 4 次提交
-
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Lukáš Doktor 提交于
Previously the _get_avocado_git_version used current directory to attempt to find out whether it's being executed from git sources, anyway this fails when running from other directory, or when running rpm-version while being inside avocado.git dir. This version uses `os.path.dirname(__file__)`, which should be in git-tree, unless one uses special configuration. Note we could use `dirname(dirname(dirname(__file__)))` but that would only work for python2 as python3 requires py2to3 fixtures, which are usually produced in `build` directory within the sources, therefor `git` is going to find the expected files just fine. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
由 Lukáš Doktor 提交于
No actual changes, just pylint/docstring fixes Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
由 Lukáš Doktor 提交于
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com> * https://github.com/avocado-framework/avocado: Makefile: keep using Python 2, but fallback to Python 3
-
- 21 9月, 2017 3 次提交
-
-
由 Cleber Rosa 提交于
This shouldn't change the experience for current users, but it makes Makefile work on environments with Python 3 only. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
And add accompanying tests that didn't exist in the origin of the code (Avocado-Virt) and that weren't added at the port time. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-