Skip to content

update expected filename on fw update test - #14451

Merged
Nir-Az merged 1 commit into
realsenseai:developmentfrom
AviaAv:tests-2
Nov 17, 2025
Merged

Nir-Az merged 1 commit into
realsenseai:developmentfrom
AviaAv:tests-2

Conversation

@AviaAv

@AviaAv AviaAv commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

Tracked on: [LRS-1349]

@AviaAv
AviaAv requested review from Nir-Az and Copilot November 17, 2025 14:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the firmware version extraction logic in the test suite to handle a more specific filename format. The regex pattern now expects underscores as delimiters and explicitly matches .bin or .img file extensions.

Key changes:

  • Modified regex pattern to use underscores exclusively and capture file extensions
  • Added logic to exclude the file extension from version groups

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


filename = os.path.basename(file_path)
match = re.search(r'[-_](\d+)[._](\d+)[._](\d+)[._](\d+)', filename)
match = re.search(r'_(\d+)_(\d+)_(\d+)_(\d+).(bin|img)', filename)

Copilot AI Nov 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dot before (bin|img) should be escaped as \. to match a literal period. Without escaping, it matches any character, which could lead to false positives in filename matching.

Suggested change
match = re.search(r'_(\d+)_(\d+)_(\d+)_(\d+).(bin|img)', filename)
match = re.search(r'_(\d+)_(\d+)_(\d+)_(\d+)\.(bin|img)', filename)

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, but we can ignore for now as dot matches a dot too

@Nir-Az
Nir-Az merged commit 9bee16a into realsenseai:development Nov 17, 2025
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants