Skip to content
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

Bug fixes for test pipeline #2764

Merged
merged 2 commits into from Feb 21, 2023
Merged

Bug fixes for test pipeline #2764

merged 2 commits into from Feb 21, 2023

Conversation

narrieta
Copy link
Member

  • Fix check for image locations
  • Fix error message for image not available in a location
  • Add combinator to existing_vm runbook
  • Fix log collection

if not any(suite.location in i.locations for i in self.images[suite.images]):
raise Exception(f"Test suite {suite.name} must be executed in {suite.location}, but no images in {suite.images} are available in that location")
for image in self.images[suite.images]:
if len(image.locations) > 0:
Copy link
Member Author

@narrieta narrieta Feb 16, 2023

Choose a reason for hiding this comment

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

The check below needs to be done only when the image specifies a location

for image in self.images[suite.images]:
if len(image.locations) > 0:
if suite.location not in image.locations:
raise Exception(f"Test suite {suite.name} must be executed in {suite.location}, but <{image.urn}> is not available in that location")
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed error message to use the URN for the image blocking the test

@@ -91,7 +90,7 @@ def _set_thread_name(name: str):
#
# Possible values for the collect_logs parameter
#
class CollectLogs(Enum):
Copy link
Member Author

Choose a reason for hiding this comment

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

comparing a string to one of the enum items was failing; changed this to be a class with string data members instead of an Enum

@@ -341,14 +340,15 @@ def _execute_test_suite(self, suite: TestSuiteInfo) -> bool:
suite_full_name = f"{suite_name}-{self.context.image_name}"
suite_start_time: datetime.datetime = datetime.datetime.now()

success: bool = True # True if all the tests succeed
Copy link
Member Author

Choose a reason for hiding this comment

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

This method is supposed to return True on success; it was returning True on failure

@@ -44,7 +46,61 @@ variable:
value: ""
is_secret: true

# Set these to use an SSH proxy
#
Copy link
Member Author

Choose a reason for hiding this comment

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

I forgot to add the combinator to this runbook in my previous PR

@codecov
Copy link

codecov bot commented Feb 16, 2023

Codecov Report

Merging #2764 (4998e3f) into develop (3aebcdd) will increase coverage by 0.01%.
The diff coverage is 82.37%.

@@             Coverage Diff             @@
##           develop    #2764      +/-   ##
===========================================
+ Coverage    71.97%   71.99%   +0.01%     
===========================================
  Files          103      104       +1     
  Lines        15692    15831     +139     
  Branches      2486     2264     -222     
===========================================
+ Hits         11295    11397     +102     
- Misses        3881     3913      +32     
- Partials       516      521       +5     
Impacted Files Coverage Δ
azurelinuxagent/ga/collect_logs.py 81.15% <0.00%> (-0.36%) ⬇️
azurelinuxagent/common/logcollector.py 88.35% <33.33%> (+0.04%) ⬆️
azurelinuxagent/common/osutil/factory.py 91.11% <33.33%> (-2.00%) ⬇️
azurelinuxagent/daemon/main.py 71.42% <33.33%> (+0.29%) ⬆️
azurelinuxagent/common/osutil/fedora.py 46.51% <46.51%> (ø)
azurelinuxagent/common/cgroupconfigurator.py 72.19% <57.89%> (-1.39%) ⬇️
azurelinuxagent/common/protocol/hostplugin.py 87.76% <75.00%> (+0.09%) ⬆️
azurelinuxagent/common/protocol/wire.py 77.37% <84.90%> (-1.18%) ⬇️
azurelinuxagent/ga/exthandlers.py 86.06% <87.50%> (+0.37%) ⬆️
azurelinuxagent/common/protocol/goal_state.py 95.59% <94.52%> (+0.27%) ⬆️
... and 25 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

# An image or image set (as defined in images.yml) specifying the images the suite must run on.
images: str
# Images or image sets (as defined in images.yml) on which the suite must run.
images: List[str]
Copy link
Member Author

Choose a reason for hiding this comment

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

I added support for multiple images/image sets so now this is a List, you'll see several changes wrapping references to this member in for loops

# Endorsed distros (ARM64) that are tested on the daily runs
endorsed-arm64:
- "mariner_2_arm64"

Copy link
Member Author

Choose a reason for hiding this comment

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

separated ARM64 into its own image set

raise Exception(f"Test suite {suite.name} must be executed in {suite.location}, but no images in {suite.images} are available in that location")
for suite_image in suite.images:
for image in self.images[suite_image]:
if len(image.locations) > 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

if len(image.locations) == 0, does that mean the image is available in any location?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, "locations" is used when the image is available only on specific regions. if not provided, or empty, it means the image should be available on all locations.

@narrieta narrieta merged commit 2c0cacd into Azure:develop Feb 21, 2023
@narrieta narrieta deleted the bug-fixes branch February 21, 2023 18:54
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.

None yet

3 participants