Skip to content

Commit

Permalink
capsule-update.robot: don't allow robotidy to mess up variable case
Browse files Browse the repository at this point in the history
Robotidy always treats first argument to 'Set Suite Variable' keyword
as a global variable. In our case, a local variable specifying name
of a global one is used.

Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
  • Loading branch information
krystian-hebel committed Oct 2, 2024
1 parent 15d618a commit c841492
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
1 change: 0 additions & 1 deletion .robotidy
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ configure = [
"RenameKeywords:ignore_library=False",
"RenameVariables:settings_section_case=upper",
"RenameVariables:variables_section_case=upper",
"RenameVariables:variables_section_case=upper",
"RenameVariables:variable_separator=underscore",
"SplitTooLongLine:split_single_value=True",
"SplitTooLongLine:align_new_line=True",
Expand Down
22 changes: 16 additions & 6 deletions dasharo-stability/capsule-update.robot
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,21 @@ Go To Ubuntu Prompt
Get System Values
[Arguments] ${var_serial} ${var_uuid} ${var_logo_sha256}

${serial}= Get Firmware Serial Number
Set Suite Variable ${VAR_SERIAL} ${serial}

${uuid}= Get Firmware UUID
Set Suite Variable ${VAR_UUID} ${uuid}
# Disable checking for variable case. Here, the first argument to 'Set Suite
# Variable' keyword is a _local_ variable holding the _name_ of the global
# one. As such, it should be lower-case, but both robotidy and robocop
# detect this as error. On top of that, 'robotidy: off' is ignored in top
# level keywords (bug?), so dummy conditional was added to make it work.
#
# robocop: off=non-local-variables-should-be-uppercase
# robotidy: off=RenameVariables
IF ${TRUE}
${serial}= Get Firmware Serial Number
Set Suite Variable ${var_serial} ${serial}

${uuid}= Get Firmware UUID
Set Suite Variable ${var_uuid} ${uuid}
END

IF ${CUSTOM_LOGO_SUPPORT} == ${TRUE}
${out}= Execute Command In Terminal
Expand All @@ -383,7 +393,7 @@ Get System Values
IF ${unplugged} == ${TRUE}
Fail Please make sure that a display device is connected to the DUT
END
Set Suite Variable ${VAR_LOGO_SHA256} ${out}
Set Suite Variable ${var_logo_sha256} ${out}
END

Prepare For ROMHOLE Persistence Test
Expand Down

0 comments on commit c841492

Please sign in to comment.