Commit Graph

710 Commits

Author SHA1 Message Date
Joel Brobecker
f68e5a3f23 commit_filer_non_ascii_subject: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: Iac2f64e6574bf0de13a001b54f095bf2b90e751e
2021-07-09 20:17:51 -07:00
Joel Brobecker
71b1061ad8 commit_filer_non_ascii_diff: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: Iecf941468e5c13a59d377fa2d2601a7b0e9baf09
2021-07-09 20:17:51 -07:00
Joel Brobecker
b5fe4bed95 commit_filer_non_ascii_body: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: Id6fa5938acf7edc75b9109c427b3175b07806cda
2021-07-09 20:17:51 -07:00
Joel Brobecker
f00c6ff362 non_ascii_char_in_diff_with_commit_email_formatter: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: I85dff8dde0ce92cc167cddf908a47d6fef40b9d1
2021-07-09 20:17:50 -07:00
Joel Brobecker
8b1b052cdf commit_email_formatter_non_ascii_subject: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: I4ac573ea7a92d1843e171f55f84264bff4cdcd7c
2021-07-09 20:17:50 -07:00
Joel Brobecker
5f7b327c2f commit_email_formatter_non_ascii_diff: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: I5d6e84b194801fc21a7811ddf74417622755b233
2021-07-09 20:17:50 -07:00
Joel Brobecker
2040768615 commit_email_formatter_non_ascii_body: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: I933c12b325a9aaca10bcaaa48ab98f31416c9b2e
2021-07-09 20:17:49 -07:00
Joel Brobecker
7df062e44b zero_max_filepath_length: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: Ibff975590a86352be3d88e0abccdff1478c29280
2021-07-09 20:17:49 -07:00
Joel Brobecker
b601b02f35 mailinglist_from_ref_name: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: I983cedbe910566ee8b6380658071c71cce61f1c8
2021-07-09 20:17:48 -07:00
Joel Brobecker
28c64b6c73 commit_checker_hook_on_tags: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: Ida6af557c5410febcf2c36349d7a49626be71dbc
2021-07-09 20:17:48 -07:00
Joel Brobecker
fb11cb2210 commit_checker_hook_on_notes: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: Ic1fea1b5133dcc341f8fd6e6a1a8df339a754d22
2021-07-09 20:17:48 -07:00
Joel Brobecker
2bbeaf7367 update_hook_reject: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: I43d3708a659bf2ccb488e5b91a8f5dce4bcba60d
2021-07-09 20:17:47 -07:00
Joel Brobecker
449310be2b update_hook_accept: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: I471342a22ef1ecfb5befc10d910acf3461be1e83
2021-07-09 20:17:47 -07:00
Joel Brobecker
a5167caf81 post_receive_hook_failure: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: I8a779f8a7df583518f2ff38a5c2a527668a2fb40
2021-07-09 20:17:47 -07:00
Joel Brobecker
4d360b3848 post_receive_hook: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: I1c4f0323d186d4ad1d80efed43c3df0f83fdc5a7
2021-07-09 20:17:46 -07:00
Joel Brobecker
a4b773e436 commit_filer: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: Ie559a797e84f286bcae0fdcfb153ce3dff502e04
2021-07-09 20:17:46 -07:00
Joel Brobecker
fcd01b7e63 mailinglist_script_failure: Add missing "os" import
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: Iafec2b4e23a128f3cf0d962b15912dbe500d7202
2021-07-09 20:17:28 -07:00
Joel Brobecker
628a3220dc mailinglist_script: Add missing "os" import in testcase script
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: Ic67d8d67eb63e6be7de3ba5a15db4bc38c4dfeec
2021-07-09 19:58:11 -07:00
Joel Brobecker
743216a142 no_meta_config_file: Add missing "os" import in testcase script
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: I569796f7c04870b46df3c188bdfaff5dd19f327e
2021-07-09 19:50:10 -07:00
Joel Brobecker
3e5eba7c32 logger_error: Add missing "os" import in testcase script
The testcase was working without before, but that was only by
chance, because we're doing a wildcard import of the support
module. Since that module will disappear when we transition
the testsuite to pytest, best to import os explicitly now.

TN: U530-006
Change-Id: I3288e3940d1370fcb0c2c6b0dcd71e05cacc2eb5
2021-07-09 19:49:54 -07:00
Joel Brobecker
eeeaf4a6c0 git_module_utest: Simplify by using testcase.repo_dir
TN: U530-006
Change-Id: I3b3ec4a5358b24746442747e7c902d553a73eae2
2021-07-07 10:46:14 -07:00
Joel Brobecker
a6adcae92b TestCase.run_unit_test_script: Reuse self.bare_repo_dir
TN: U530-006
Change-Id: I37e7cc3107a02e7963e3712680513686fc9b7bd7
2021-07-07 10:42:02 -07:00
Joel Brobecker
23efd593fb testsuite: Replace the "TEST_DIR" global by a TestCase.work_dir property
This is another preparation patch towards the transition to pytest where
testsuite support code is accessed through fixtures, rather than imports.
Having the equivalent of this information available as a property rather
than a global means we have access to this information though the "testcase"
object, something that works both with the current testsuite framework
and with the future pytest-based testsuite framework.

Note that the changes in the testcases themselves have been semi-automated.
I started with...

    $ cd testsuite/tests
    $ perl -pi -e 's/TEST_DIR/testcase.work_dir/g' */run_test.py

And then fixed up by hand the 30 testcases or so which had failures
in them. For the most part, it was about removing the import of
TEST_CASE, which had been replaced by an import of testsuite.work_dir.

TN: U530-006
Change-Id: I154dd58832dc10909623b869c488aa39edaf4c2d
2021-07-04 19:15:13 -07:00
Joel Brobecker
6310e92598 testsuite/lib/support.py: Remove import of "cd"
This import is no longer used by any testcase, and can be removed.
This ensures we don't re-introduce calls to this function in the future.

This is part of the transition of the testsuite to pytest, where
testcase should not be changing the global environment (such as
the current working directory).

TN: U530-006
Change-Id: I13b0f4882295ad5980c92c0ee726d48614448284
2021-07-04 19:14:22 -07:00
Joel Brobecker
956950ee67 Remove all calls to "cd" in all testcases
All these calls are now superflous, so this commit removes them.

Note that this change was made entirely automatically, using
the following command:

    $ cd testsuite/tests
    $ perl -i -0pe 's/^\s*cd\([^\n]*\n+//gms' */run_test.py

Translation: Find all lines that start with spaces, followed by "cd(",
and then delete everything, including empty lines after it (if any).

The following command was then executed to automatically remove
all imports of "cd", which are now superfluous:

    $ cd testsuite/tests
    $ perl -i -e 's/ cd,//' */run_test.py

This helps our goal of avoiding changes to the global environment,
which is a requirement before we can transition the testsuite to
pytest.

TN: U530-006
Change-Id: Ia84162550648e622d8ab2d1b3210c8c4eeb0219b
2021-07-04 19:13:21 -07:00