-
Notifications
You must be signed in to change notification settings - Fork 18
Implement extensions mechanism and add HCKTrace #843
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
base: master
Are you sure you want to change the base?
Changes from all commits
db7b4a0
26f3845
f19d931
c9acd93
46f5803
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 |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| { | ||
| "extra_software": [ | ||
| "hcktrace" | ||
| ], | ||
| "post_start_commands": [ | ||
| { | ||
| "desc": "Configure HCKTrace service for driver tracing", | ||
| "guest_run": "Start-Process -Wait -FilePath hcktrace.exe -ArgumentList driver,@driver_short_name@,@driver_dir@,4" | ||
|
||
| } | ||
| ], | ||
| "tests_config": [ | ||
| { | ||
| "tests": [ | ||
| ".*" | ||
| ], | ||
| "pre_test_commands": [ | ||
| { | ||
| "desc": "Start HCKTrace recording", | ||
| "guest_run": "Start-Process -Wait -FilePath hcktrace.exe -ArgumentList test,@safe_test_name@" | ||
| } | ||
| ], | ||
| "post_test_commands": [ | ||
| { | ||
| "desc": "Stop HCKTrace recording", | ||
| "guest_run": "Start-Process -Wait -FilePath hcktrace.exe -ArgumentList test,end", | ||
| "files_action": [ | ||
| { | ||
| "remote_path": "C:/hcktrace/zip", | ||
| "local_path": "@workspace@/trace-@safe_test_name@-@client_name@-@run_number@", | ||
| "direction": "remote-to-local", | ||
| "move": true, | ||
| "allow_missing": true | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # typed: strict | ||
| # frozen_string_literal: true | ||
|
|
||
| module AutoHCK | ||
| module Models | ||
| class Extension < T::Struct | ||
| extend T::Sig | ||
| extend JsonHelper | ||
|
|
||
| prop :short, T.nilable(String) | ||
|
|
||
| const :extra_software, T::Array[String], default: [] | ||
| const :post_start_commands, T::Array[CommandInfo], default: [] | ||
| const :tests_config, T::Array[TestConfig], default: [] | ||
| end | ||
| end | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,6 +76,7 @@ def set_machine_ready | |
|
|
||
| def post_start_commands | ||
| (@project.engine.drivers.flat_map(&:post_start_commands) + | ||
| @project.engine.extensions.flat_map(&:post_start_commands) + | ||
| @setup_manager.client_post_start_commands).select(&:guest_run) | ||
| end | ||
|
|
||
|
|
@@ -107,16 +108,26 @@ def install_driver(driver) | |
| force_install_cert: driver.install_cert) | ||
| end | ||
|
|
||
| def insert_driver_replacement(driver, one_driver, replacement) | ||
| client_replacement = replacement.transform_keys { |k| k.dup.insert(1, "#{driver.short}.") } | ||
|
||
| @replacement_map.merge!(client_replacement) | ||
| @replacement_map.merge!({ '@driver_short_name@' => driver.short }) | ||
|
|
||
| # If there is only one driver, we can use generic keys without driver short name. | ||
| @replacement_map.merge!(replacement) if one_driver | ||
| end | ||
|
Comment on lines
+111
to
+118
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. The To fix this, the logic for setting def insert_driver_replacement(driver, one_driver, replacement)
client_replacement = replacement.transform_keys { |k| k.dup.insert(1, "#{driver.short}.") }
@replacement_map.merge!(client_replacement)
# If there is only one driver, we can use generic keys without driver short name.
if one_driver
@replacement_map.merge!({ '@driver_short_name@' => driver.short })
@replacement_map.merge!(replacement)
end
end |
||
|
|
||
| def install_drivers | ||
| one_driver = @project.engine.drivers.one? | ||
|
|
||
| @project.engine.drivers&.each do |driver| | ||
| if driver.install_method == AutoHCK::Models::DriverInstallMethods::NoDrviver | ||
| @project.logger.info("Driver installation skipped for #{driver.name} in #{@name}") | ||
| next | ||
| end | ||
|
|
||
| driver_replacement = install_driver(driver) | ||
| client_replacement = driver_replacement.transform_keys { |k| k.dup.insert(1, "#{driver.short}.") } | ||
| @replacement_map.merge!(client_replacement) | ||
| insert_driver_replacement(driver, one_driver, driver_replacement) | ||
| end | ||
|
|
||
| @logger.debug("Driver replacement list: #{@replacement_map.dump_string}") | ||
|
|
||
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.
Grammar issue: 'for run test' should be 'to run tests' or 'for running tests'.
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.
Cursor VS Copilot haha