You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some e3-testsuite-based testsuites define a test.py script for each testcase, make the driver execute that script plus some pre-/post-processing steps. These test.py scripts typically import a harness module shared with the main testsuite process, and that module will load data that has been serialized by the driver.
This data generally includes
some of the main process's command-line options, i.e. information about the run as a whole,
the test_env received by the driver, i.e. information that parameterizes test.py.
As things stand, testsuite drivers need to devise their own serialization strategy, e.g. a record where the driver will tuck Env() platforms, test_env items, etc; the driver will pickle that record, spawn test.py and let it un-pickle the record.
It would be convenient to use e3.env's existing de/serialization code for this, using a protocol along the lines of:
# Driver side:testcase_env=BaseEnv.from_env() # Copy Env singleton into a non-global instance.testcase_env.test_env=self.test_env# Add per-testcase data.testcase_env.store(self.working_dir(harness.TESTCASE_ENV_FILE))
self.shell(["test.py"]) # Spawn test.py in self.working_dir().# test.py side:Env.restore(harness.TESTCASE_ENV_FILE)
However, currently this cannot work:
BaseEnv.from_env only copies the build, host & target platforms; it does not copy other attributes;
BaseEnv.copy does not accept Env parameters;
only Env has store & restore methods.
Filing this enhancement request after chatting with @Nikokrock. The title might be too biased toward a preconceived solution; open to discussing the use-case more and seeing where else we can go.
The text was updated successfully, but these errors were encountered:
Hi!
Some e3-testsuite-based testsuites define a
test.py
script for each testcase, make the driver execute that script plus some pre-/post-processing steps. Thesetest.py
scripts typicallyimport
a harness module shared with the main testsuite process, and that module will load data that has been serialized by the driver.This data generally includes
test_env
received by the driver, i.e. information that parameterizestest.py
.As things stand, testsuite drivers need to devise their own serialization strategy, e.g. a record where the driver will tuck
Env()
platforms,test_env
items, etc; the driver will pickle that record, spawntest.py
and let it un-pickle the record.It would be convenient to use e3.env's existing de/serialization code for this, using a protocol along the lines of:
However, currently this cannot work:
BaseEnv.from_env
only copies the build, host & target platforms; it does not copy other attributes;BaseEnv.copy
does not acceptEnv
parameters;Env
hasstore
&restore
methods.Filing this enhancement request after chatting with @Nikokrock. The title might be too biased toward a preconceived solution; open to discussing the use-case more and seeing where else we can go.
The text was updated successfully, but these errors were encountered: