-
Notifications
You must be signed in to change notification settings - Fork 20
Update user checks #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update user checks #146
Changes from 7 commits
3235388
8cb891d
6229af5
eb41f84
750b7fb
89397ad
8c5d2c9
16d927f
76dde25
fdf5e29
dd13d82
b93ed97
5170018
702645c
9b0429b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,4 +21,5 @@ venv/ | |
| *.log | ||
| venv | ||
| venv37 | ||
| .vscode/ | ||
| .venv | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,11 @@ | ||
| __version__ = "0.5.7" | ||
|
|
||
| import fixate.sequencer | ||
| import fixate.config | ||
|
|
||
| # Create the global sequencer here so it can be imported and | ||
| # used elsewhere with better traceability/type-hints/auto-complete | ||
| global_sequencer = fixate.sequencer.Sequencer() | ||
| # Plan to deprecate calls to RESOURCES[] and gradual replace. | ||
| # Keep here now for backwards-compatibility with test_scripts | ||
| fixate.config.RESOURCES["SEQUENCER"] = global_sequencer | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| from zipimport import zipimporter | ||
| from pubsub import pub | ||
| import fixate.config | ||
| import fixate | ||
| from fixate.core.exceptions import SequenceAbort | ||
| from fixate.core.ui import user_serial, user_ok | ||
| from fixate.reporting import register_csv, unregister_csv | ||
|
|
@@ -110,7 +111,7 @@ | |
| ) | ||
|
|
||
|
|
||
| def load_test_suite(script_path, zip_path, zip_selector): | ||
| def load_test_suite(script_path: str, zip_path: str, zip_selector: str): | ||
| """ | ||
| Attempts to load a Fixate Script file from an absolute path. | ||
| Try loading from zip, then direct script otherwise | ||
|
|
@@ -163,8 +164,7 @@ def __init__(self, test_script_path, args): | |
| # General setup | ||
| self.test_script_path = test_script_path | ||
| self.args = args | ||
| self.sequencer = fixate.sequencer.Sequencer() | ||
| fixate.config.RESOURCES["SEQUENCER"] = self.sequencer | ||
| self.sequencer = fixate.global_sequencer | ||
|
|
||
| # Environment specific setup | ||
| # TODO remove this to plugin architecture | ||
|
|
@@ -212,7 +212,7 @@ def run_fixate(self): | |
|
|
||
|
|
||
| class FixateWorker: | ||
| def __init__(self, sequencer, test_script_path, args): | ||
| def __init__(self, sequencer: fixate.sequencer.Sequencer, test_script_path, args): | ||
| self.sequencer = sequencer | ||
| self.test_script_path = test_script_path | ||
| self.args = args | ||
|
|
@@ -374,6 +374,7 @@ def run_main_program(test_script_path=None): | |
|
|
||
| fixate.config.load_config(args.config) | ||
| fixate.config.load_dict_config({"log_file": args.log_file}) | ||
| # Could this be replaced with a simple log_file variable in fixate.config ^ ? | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good question, I wouldn't mind talking to @clint-lawrence about the motivation for using the load_dict_config method. But, I don't think it's something that's pertinent to this PR. @clint-lawrence, do you think it would be worth enabling discussions so that things like this can be flagged there instead of random comments in code?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could just create an issue?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I had thought that, but I had a Wall-E spork moment, and didn't really think that it's an issue per se. But happy to stick with using issues. |
||
| supervisor = FixateSupervisor(test_script_path, args) | ||
| exit(supervisor.run_fixate()) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been slowly trying to remove any object instantiation from happening at import time. Depending on how tangled things are, it might be a good change to do that here? The main entry point would create the Sequencer object and assign it to the global at startup. (this is probably something that should be deferred to a follow PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this could be a complete mess, because test scripts at the moment might rely on reference to the Sequencer at import time :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted and moved to a separate branch. Nearly all our current test scripts fails the new atzip.pyz checks due to this, so will spend a bit more time cleaning it up there.