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

test: add test for worker that requires no instance profile #481

Merged
merged 5 commits into from
Nov 19, 2024

Conversation

YutongLi291
Copy link
Contributor

@YutongLi291 YutongLi291 commented Nov 16, 2024

What was the problem/requirement? (What/Why)

The worker agent is able to be installed with the option disallow-instance-profile, in which case if the worker instance is booted with an instance profile, the worker agent will shut itself down and not run jobs.

We should verify that this functionality works as expected and that there are no regressions

What was the solution? (How)

Add a test to verify that the worker will not pick up any jobs in the case that the worker is configured to not have instance profiles, but the instance has a profile anyway.

Also upgraded test-fixtures version from 0.16 to 0.17 to allow for the option to disallow instance profile.

What is the impact of this change?

Better verification of worker agent installer code and behaviour.

How was this change tested?

# Linux
source .e2e_linux_infra.sh
hatch run e2e-test

# Windows
source .e2e_windows_infra.sh
hatch run e2e-test

Was this change documented?

No

Is this a breaking change?

No


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@YutongLi291 YutongLi291 requested a review from a team as a code owner November 16, 2024 01:28
@YutongLi291 YutongLi291 changed the title No instance profile test: add test for worker that requires no instance profile Nov 16, 2024
@YutongLi291 YutongLi291 enabled auto-merge (squash) November 16, 2024 01:53
@YutongLi291 YutongLi291 merged commit d305daa into aws-deadline:mainline Nov 19, 2024
15 checks passed
YutongLi291 added a commit to YutongLi291/deadline-cloud-worker-agent-fork that referenced this pull request Nov 20, 2024
…line#481)

* test: add test for worker that requires no instance profile

Signed-off-by: Li <[email protected]>
function_worker_factory(
dataclasses.replace(
worker_config,
disallow_instance_profile="True",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it expected to cause lint error?

test/e2e/test_worker_config.py:33: error: Unexpected keyword argument
"disallow_instance_profile" for "replace" of "DeadlineWorkerConfiguration"  [call-arg]
                dataclasses.replace(
                ^
Found 1 error in 1 file (checked 145 source files)

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

4 participants