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

fix: set python container version explicitly #776

Merged
merged 5 commits into from
Nov 1, 2023
Merged

fix: set python container version explicitly #776

merged 5 commits into from
Nov 1, 2023

Conversation

ajberdy
Copy link
Contributor

@ajberdy ajberdy commented Nov 1, 2023

Issue #, if available:

Description of changes:

Previous set up was skipping even when version matched

Testing done:

integ test passing with correct python version and skipping with incorrect

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ajberdy ajberdy requested a review from a team as a code owner November 1, 2023 00:08
@@ -200,7 +201,7 @@ def test_completed_quantum_job(aws_session, capsys):


@pytest.mark.xfail(
(sys.version_info.major, sys.version_info.minor) != decorator_python_version,
(sys.version_info.major, sys.version_info.minor) != (3, 10),
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand why the previous setup doesn't work. Could you please add more details on what is causing that to fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the fixture doesn't get evaluated inside the decorator, so this comparison is something like (3, 10) != <pytest.fixture-decorator_python_version>

Not sure how this didn't get caught in its pr, but there was a lot of back and forth with the method for skipping and looks like the final version missed the mark

Copy link
Contributor

Choose a reason for hiding this comment

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

Does it necessarily need to be a fixture? Can it be instead set to a regular variable?

# image_uri = retrieve_image(Framework.BASE, aws_session.region)
# tag = aws_session.get_full_image_tag(image_uri)
# major_version, minor_version = re.search(r"-py(\d)(\d+)-", tag).groups()
# return major_version, minor_version
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll capture a follow-up to go back to getting the python version from the container in the code, but setting manually to 3.10 to unblock

Copy link

codecov bot commented Nov 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e7bbc8a) 100.00% compared to head (756d287) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #776   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          129       129           
  Lines         8360      8360           
  Branches      1862      1862           
=========================================
  Hits          8360      8360           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ajberdy ajberdy requested a review from kshitijc November 1, 2023 00:15
@ajberdy
Copy link
Contributor Author

ajberdy commented Nov 1, 2023

Getting an error now with outputs on the integ tests, believe this is also related to the containers change

Error is fixed with latest code change, it's still the input links bug

@ajberdy
Copy link
Contributor Author

ajberdy commented Nov 1, 2023

I have confirmed that integ tests PASS with 3.10 on the latest commit and have verified skipping with 3.9 since the last change to the xfail decorators

@ajberdy
Copy link
Contributor Author

ajberdy commented Nov 1, 2023

Reverified passing tests since last commit

@@ -244,6 +244,8 @@ def decorator_job(a, b: int, c=0, d: float = 1.0, **extras):
with open("test/output_file.txt", "w") as f:
f.write("hello")

return job_test_script.job_helper()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

switched this test to use the return method for more variety

@@ -304,6 +305,7 @@ def decorator_job_submodule():
) as f:
assert f.readlines() == ["pytest\n"]
assert dir(pytest)
save_job_result(submodule_helper())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved this line lower so if something above fails the results assert will fail

Copy link
Contributor

@kshitijc kshitijc left a comment

Choose a reason for hiding this comment

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

Do we also need a test for decorators in the containers repo?

@ajberdy
Copy link
Contributor Author

ajberdy commented Nov 1, 2023

Do we also need a test for decorators in the containers repo?

Good call, I'll capture a task to add this

@ajberdy ajberdy merged commit 524b1a1 into main Nov 1, 2023
22 checks passed
@ajberdy ajberdy deleted the integ-fix branch November 1, 2023 01:11
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.

2 participants