Should NRunner support the AVOCADO_* environment variables for non-instrumented tests like the legacy runner? #4751
Replies: 4 comments 9 replies
-
Hi @willianrampazzo, sorry for the delay here and thanks for bring starting this discussion. IMO, we should think about some method of sharing those with the all type of tests, but not only those variables. Besides the first one (AVOCADO_VERSION), IIUC, most of those variables are present inside Maybe we could save the entire runtime dict at some place and export only one env: What do you think? |
Beta Was this translation helpful? Give feedback.
-
Hi @willianrampazzo , First let me try to summarize your findings about each of the environment variables. First, the non issues are:
Which leaves us with Now, about your questions, I'm following up with my answers: Q) Should we support all of these environment variables for non-instrumented tests on nrunner? Q) Should we support only those already available for non-instrumented tests on runnable config? Q) Should we deprecate the use of those environment variables for non-instrumented tests on nrunner? |
Beta Was this translation helpful? Give feedback.
-
Adding more context to the discussion, @beraldoleal gave the idea of reviewing the meaning of each variable. The Here is the output of
As you can see, those are related to the test execution. Basically, everything except for the
Considering the nrunner allows spawners anywhere different from the host system, the only idea I had was to check if the directories exist; if not, create them, but is there any value for the user here? The user will need to access the target location to look at the content. Comments, again, are appreciated @beraldoleal, @clebergnu, @richtja, @ana. |
Beta Was this translation helpful? Give feedback.
-
Before I comment, let me just record that while working on the switch to the nrunner, specifically on We have a sample test,
Comparing with nrunner:
|
Beta Was this translation helpful? Give feedback.
-
While I was investigating how to implement #4742, I reached some walls that depend on some discussion.
In the legacy runner, the following environment variables are set for any kind of test:
For instrumented tests, those environment variables are set inside the Test class, independent of runner/nrunner:
avocado/avocado/core/test.py
Lines 874 to 883 in 8c87bfe
For non-instrumented tests, while it is possible to set AVOCADO_VERSION, AVOCADO_TEST_BASEDIR, AVOCADO_TEST_LOGDIR, and AVOCADO_TEST_OUTPUTDIR using the values from runnable config, AVOCADO_TEST_WORKDIR and AVOCADO_TEST_LOGFILE are not defined.
In the current implementation of nrunner, the information about the test is exchanged using the messages mechanism, so the AVOCADO_TEST_LOGFILE does not need to be available to the test or even exist in some cases.
The AVOCADO_TEST_WORKDIR is a temporary folder created for the test. It can make use of the folder if needed.
Below is a search restricted to GitHub of projects using those environment variables:
AVOCADO_VERSION
AVOCADO_TEST_BASEDIR
AVOCADO_TEST_WORKDIR
AVOCADO_TEST_LOGDIR
AVOCADO_TEST_LOGFILE
AVOCADO_TEST_OUTPUTDIR
Considering users may not be using most of these environment variables, and given the dilemma of supporting some on nrunner, like AVOCADO_TEST_WORKDIR and AVOCADO_TEST_LOGFILE, the questions I have to start a discussion are:
Beta Was this translation helpful? Give feedback.
All reactions