8 Commits
Author SHA1 Message Date
Castulo Martinez 7dd6fc221a Testlib: renaming variables for consistency
Environment variables are used everywhere in testilb. This environment
variables are global variables that define the way testlib behaves.
However is was confusing to use the variables because they were
inconsistent between each other, for example some variables that define
paths would have absolute paths while other would have relative paths,
making it error prone while using them.

This commit makes the environment variables more consistent by following
a name convention for each type of variable, as an example, variables
that define absolute paths follow this convention ABS_<path_name>_DIR,
while variables that define relative paths are defined like this
<path_name>_DIR.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2020-06-16 11:42:13 -07:00
Otavio Pontes 5bb4ef2337 swupd.bash: Make swupd.bash POSIX compliant
Bash autocomplete scripts should be POSIX compliant, so fixing that and
adding a test to validate this.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-19 13:47:49 -07:00
Otavio Pontes d29865f8a9 swupd.bash: Fixing tests
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-05-05 09:09:53 -07:00
Otavio Pontes eeb3d61fea testlib: Always remove test enviroment implicitly at the end of tests
Current implementation was only removing test enviroment for envs created
on test setup. And test_teardown function needed to be overriden in case
global_setup() was used.

Now always cleaning the enviroment for both use cases, test_setup() and
global_setup(). The user doesn't have the control anymore on that and
if the user wants to keep the env KEEP_ENV variable should be used.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-07 13:52:49 -07:00
Otavio Pontes b1e849327d testlib: never create test enviroment for the user
Test environment can be created on global_setup() or test_setup() and that
change the behavior of several operations on testlib.

Because of that, let the user create the test environment as desired instead
of forcing it on test_setup()

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-04-07 13:52:49 -07:00
Otavio Pontes d61288464d tests: Auto rebalance tests based on how long they take to long
This patch adds 2 scripts used to balance test execution. The weight_tests.bash
runs all tests and sets a weight to them based on how long they take to run. The
other, filter_bats_list.bash, use this information to split the tests in groups to
be executed by github actions.
When a new test is added the script will consider it with an average weight, so this
shouldn't unbalance the system right away. After some time, if we notice that the
system is not balanced anymore we can just run the weight_tests.bash again to rebalance.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2020-02-20 13:22:31 -08:00
Castulo Martinez 67e4e8dda9 Autocompletion for --debug and --quiet
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-03-28 13:05:36 -07:00
Castulo Martinez cf8f81ccb4 Test for configurable download retries
This commit adds the tests to validate the configurable retries
for sync downloads.

It also moves the tests for autocompletion from their own "completion"
directory to a more general "usability" directory so we can add more
tests in that directory in the future.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-02-01 12:30:45 -08:00