- 16 2月, 2018 1 次提交
-
-
由 Cleber Rosa 提交于
This brings a change in behaviour, in which the stdout/stderr of the executed process will now be of bytes type, instead of a string type. Two new attributes, which are implemented as properties, have been added to the CmdResult class, `stdout_text` and `stderr_text`. Those are convenience methods that will return the same content that is in `stdout` and `stderr`, reespectively, but decoded on the fly[1]. With regards to encoding, if one is not provided, the result of `sys.getdefaultencoding()` will be used ("utf-8" for Python 3 and "ascii" for Python 2). Applications and/or tests using the APIs that return a CmdResult should, to the best of my knowledge, set a default encoding themselves so a stable behavior across Python versions. But that if left to users of this API. A different tradeoff/design decision has to do with the tests modified here. One option is to have "text" (as in sequences of human readable glyphs) as being of Python type "str". On Python 2, "str" can be compared to "bytes" because a conversion will happen on demand. That is, the following is fine on Python 2: >>> result = process.run("command") >>> "expected" in process.stdout Where `expected` is of type "str" and `process.stdout` is of type "bytes". This is not true of Python 3, so either the types must match or a conversion must be done explicitly. The solutions to that are: 1) have these "text" as (of type) "bytes" in the source code itself, and avoid the conversion whenever possible 2) have "strings" in the source code itself, and use the conversion provided by `CmdResult.stdout_text` and `CmdResult.stderr_text`. The approach chosen here is to avoid conversion if possible, that is, use "byte" types, given the fact that the source code encoding is by default 'ascii' and most of the "text" dealt with here can be represented in 'ascii' too. This is equivalent of doing: result = process.run("command") b"expected" in process.stdout "errors: %s" % 0 in process.stderr_text [1] The obvious alternative, instead of decoding these on the fly would be to have multiple copies of the "same" data. This assumes that binary data produced on the stdout/stderr will usually be larger than textual data. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 15 2月, 2018 2 次提交
-
-
由 Cleber Rosa 提交于
This is similar to the xunit unittest changes in 353fed04, but now applied to the functional tests which happen to use the same features. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
This is similar to the change in 418bf92a, but now applied to the functional tests that deal with xunit. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 12 2月, 2018 2 次提交
-
-
由 Cleber Rosa 提交于
Avocado used to provide support for "test aliases", that is, one could call "avocado run synctest" when the file containing the test was named "synctest.py". See e65ff614 for an example. Since this "feature" has been long removed, let's remove the tests also. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Remove variable assigments that are used just once and never actually used. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 10 2月, 2018 1 次提交
-
-
由 Amador Pahim 提交于
Currently simple tests have a limited status API, being able to set only the WARN status by generating an output string in a very specific and hard-coded format. This patch, while respects the current behaviour, creates configuration keys, allowing users to provide regular expressions to search for in the test outputs, aiming to set the final test status to either WARN or SKIP when the test finishes with exit code 0. Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
- 14 12月, 2017 1 次提交
-
-
由 Cleber Rosa 提交于
A lot of the core Avocado code still refers to "mux" based terminology. For instance, what was previously "mux_path" is now "parameter paths", and what was previously "mux" is now really variants. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 06 12月, 2017 1 次提交
-
-
由 Cleber Rosa 提交于
This is an attempt to catch most (if not all) usages of open that do not follow the context manager pattern. Sometimes, for better readability, our own `genio` library is used. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 15 11月, 2017 1 次提交
-
-
由 Lukáš Doktor 提交于
The test_basic.RunnerOperationTest.test_early_latest_result waits for link creation for 0.5s and then it simply fails, without waiting for the process. The problem is that in such case the tmpdir can be cleaned before it's used by the created process and therefor left behind. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
- 13 10月, 2017 1 次提交
-
-
由 Cleber Rosa 提交于
Basically switch to use the alias provided by six, with the Python 3 name. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 11 10月, 2017 1 次提交
-
-
由 Cleber Rosa 提交于
This changes uses the six compatibility equivalents for iterkeys, iteritems and itervalues. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 03 10月, 2017 2 次提交
-
-
由 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 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>
-
- 15 9月, 2017 1 次提交
-
-
由 Lukáš Doktor 提交于
The basedir was mainly set correctly, but sometimes not used in some of the tests. Let's move the `os.chdir` to `setUp` phase where it makes sense and add new ones where they were not present. Related to basedir the test_mux was using hardcoded path based on the method used to execute the test, let's change it to `__file__` which gives better results. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
- 24 8月, 2017 1 次提交
-
-
由 Cleber Rosa 提交于
These scripts rely on some Python library path manipulation to be able to load from the source tree. But, in fact that are a few reasons for not having those, including: * All functionality in `avocado` relies on plugins, which will not be available from the source tree unless a `$ setup.py develop` is executed, which automatically makes the "import magic" unnecessary. * Most users will end up using a setuptools generated "entry point" instead. For the sake of less code, I propose this (and all other?) magic to be removed. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 16 8月, 2017 1 次提交
-
-
由 Lucas Meneghel Rodrigues 提交于
Found by the newest version of inspektor, 0.4.5. Signed-off-by: NLucas Meneghel Rodrigues <lookkas@gmail.com>
-
- 14 8月, 2017 1 次提交
-
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 11 8月, 2017 1 次提交
-
-
由 Lukáš Doktor 提交于
There are bunch of really short, one-time-used variables defined globally, which is not really necessary, nor easy to follow. Let's just define those one/two liners directly to where they are used. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
- 06 8月, 2017 2 次提交
-
-
由 Lukáš Doktor 提交于
The fail_reason is the instance of the actual exception. We do store it only as string in case of old-type exception, but even new style exceptions might be not available when sys.path is different causing unpickle on runner part impossible. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
由 Lukáš Doktor 提交于
When no variants are provided Avocado sets the default variant, but instead of list of mux paths it created just string "/run", which processed into ["/", "r", "u", "n"]. Let's fix this by setting list. Also the proper mux_path should be `/run/*` in order to include all children nodes of the "/run". Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
- 24 5月, 2017 2 次提交
-
-
由 Cleber Rosa 提交于
Just like `avocado list` presents the statistics for the test types, it may be useful to also list the number of tests that have a particular tag. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Test tags (via docstring directives) have been supported in Avocado for a number of releases, but up until now user would only be able to see the tags on their tests by resorting to the source code. This was already difficult when the tags where set only at the class level, now that they can be set both on the class and method docstring, users would have to do the "math" on their minds. Let's display the test tags when the verbose switch is given to the list command to make the life of users easier. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 23 5月, 2017 1 次提交
-
-
由 Cleber Rosa 提交于
Since too may reports of false positives have been generated during RPM package builds, let's move all test sensitive tests into level 1. This means that those tests will not be run on RPM package builds, but will continue to run on Travis-CI. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 18 5月, 2017 1 次提交
-
-
由 Amador Pahim 提交于
Introducing the --force-execution to create the Job regardless the fact that some test references might not be resolved to tests. Reference: https://trello.com/c/bDUJjhq0Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
- 15 5月, 2017 1 次提交
-
-
由 Cleber Rosa 提交于
A finer level of granularity may help to extend our testing coverage while reducing the amount of false positives. This introduces the three different levels, mapped like this: * level 0, AKA "make check" * level 2, AKA "make check-full" There are no changes of test assignment, that is, tests previously being run under "check-full" will continue to be run only at that target. The same is true for tests that would run under "make check" before this. The big change is that there's now a middle ground, that can be activated by manually setting the AVOCADO_CHECK_LEVEL variable. Level 1 is intended to be used be used on environments that are halfway between a dedicated machine and a really low powered environment. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 27 4月, 2017 1 次提交
-
-
由 Amador Pahim 提交于
Due to the deprecation of the self.skip(), the availability of the skip decorators and the new CANCEL status, some internal improvements are important to keep our behaviour sane and our own code sound and clean. - The test.SkipTest class was renamed to test.MockingTest to be even more generic, intending to be overridden by sub-classes that make the test to end both with SKIP or CANCEL status. To keep it generic, test.MockingTest class will not SKIP the test if used directly anymore. - The test.TimeOutSkipTest and test.ReplaySkipTest classes now are using the skip decorators instead of raising an exception in setUp(), since 'skipping' the test means 'don't execute anything', not even the setUp(). - The test.DryRunTest class, which is expected to log itself in setUp() and then abort the test execution, is now using self.cancel() (instead of raising a SKIP exception), being now compliant with the concept that a SKIP test cannot execute anything. - Selftests were adjusted accordingly. Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
- 25 4月, 2017 1 次提交
-
-
由 Lukáš Doktor 提交于
Currently there is a hardcoded test-postprocess timeout consisting of two cycle-timeouts which is something between 1 and 2 seconds. This is not sufficient on heavily loaded machines so this patch increases the timeouts to: 1s: when test was interrupted (ctrl+c/timeout) 10s: when the process died but the status was not yet delivered 60s: when test reported status but the process did not finish taking into account the current available test/job timeout. As those deadlines are significantly longer, users could have noticed a frozen throbber, which is why I propagate the results_dispatcher and handle the throbber also during the postprocess, which makes this patch a bit more complicated than one would expect. I used "progress = False" to distinguish between running test and postprocessing it. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
- 24 4月, 2017 1 次提交
-
-
由 Lukáš Doktor 提交于
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
- 21 4月, 2017 1 次提交
-
-
由 Cleber Rosa 提交于
As it has already been done to some other tests, two other tests have been producing false positives. This has been observed recently in package builds in build farms. Let's run them only when `make check-full` is called, which is usually done at dedicated machines with plenty of resources. Reference: https://kojipkgs.fedoraproject.org/work/tasks/9189/19059189/build.log Reference: https://kojipkgs.fedoraproject.org/work/tasks/9445/19069445/build.logSigned-off-by: NCleber Rosa <crosa@redhat.com>
-
- 20 4月, 2017 1 次提交
-
-
由 Lukáš Doktor 提交于
The MissingTest is yielded by TestLoaderProxy, but it was implemented and described in FileLoader, which caused troubles when FileLoader was not being used. This simple fix allows TestLoaderProxy to define basic mappings and adds MissingTest to it. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
- 06 4月, 2017 1 次提交
-
-
由 Lukáš Doktor 提交于
Currently the `selftests/run_coverage` only reports unit coverage. This patch allows specifying custom `avocado` command in selftests and uses it to run coverage to also include the functional tests to results. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
- 04 4月, 2017 1 次提交
-
-
由 Amador Pahim 提交于
`system-out` should be in the same level as `failure`, but we are creating it as a `failure` child. This patch puts system-out in the same level as `failure` and adds the functional test to validate all the xunit outputs against the junit-4.xsd schema. Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
- 28 3月, 2017 1 次提交
-
-
由 Lukáš Doktor 提交于
Recently we added a check for canceled test, let's also check the "cancel" number of tests are reported correctly in json plugin. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
- 27 3月, 2017 1 次提交
-
-
由 Amador Pahim 提交于
self.skip() is to be deprecated. This is the first step, adding a message to the exception raised by the self.skip() and adjusting the examples tests accordingly. Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
- 09 3月, 2017 1 次提交
-
-
由 Cleber Rosa 提交于
On some environments, such as when building RPM packages, very little can be assumed to be available. `man` is such as command that is *not* available, so let's check for it and skip tests accordingly. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 08 3月, 2017 1 次提交
-
-
由 Lucas Meneghel Rodrigues 提交于
Signed-off-by: NLucas Meneghel Rodrigues <lookkas@gmail.com>
-
- 24 2月, 2017 1 次提交
-
-
由 Lukáš Doktor 提交于
I'm not 100% sure, but I don't see a benefit in allowing people to override test status from inside test. They are suppose to use assertions, or `self.fail`-like methods. With this change it'd be harder to manually override the test status (as can be seen on updated unittests) but we minimize the accidental write into `self.status` variable, which can lead to confusing results. Note we can consider adding `set_status` method to allow setting this property, but I'd like to avoid allowing direct `self.status = ` usage. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
- 06 2月, 2017 1 次提交
-
-
由 Cleber Rosa 提交于
The unittest standard library on Python 2.7 an later has everything that the unittest2 backport is supposed to have. Let's then drop all the conditional imports of unittest2 and stick with unittest. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 03 2月, 2017 1 次提交
-
-
由 Cleber Rosa 提交于
There's one functional test that is missing "--sysinfo=off". I happened to find this because lspci on my system hangs when running under X. That test would timeout at the sysinfo collection. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 12 1月, 2017 1 次提交
-
-
由 Amador Pahim 提交于
To provide support for passing arguments for simple tests in command line, we were creating some cases where the test reference could not be properly handled. Also, for test references with white-spaces, we have an inconsistent behavior. See reference. This patch removes the support for arguments in test references, restoring the proper behavior, which is expected to be shell-like. As consequence, we now handle correctly white-spaces in tests references as well as Unicode characters. Reference: https://www.redhat.com/archives/avocado-devel/2016-November/msg00011.html Reference: https://trello.com/c/bfE9NBblSigned-off-by: NAmador Pahim <apahim@redhat.com>
-