aws-deadline / deadline-cloud-worker-agent

The AWS Deadline Cloud worker agent can be used to run a worker in an AWS Deadline Cloud fleet.
Apache License 2.0
15 stars 21 forks source link

test: simplify test fixtures #492

Closed jusiskin closed 59 minutes ago

jusiskin commented 1 day ago

Depends on release of aws-deadline/deadline-cloud-test-fixtures#164

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

  1. The worker agent end-to-end tests had overridden the worker_config fixture from deadline-cloud-test-fixtures to work around bugs and enhance its functionality. This bug has been fixed upstream (see aws-deadline/deadline-cloud-test-fixtures#164)

  2. The worker agent end-to-end tests had used a combination of:

    pytest.mark.parametrize("operating_system", ["linux"], indirect=True)
    pytest.mark.skipif(os.environ["OPERATING_SYSTEM"] == "windows")

    These are redundant. We should not need to use both of the above for each test case.

What was the solution? (How)

  1. Modify the worker_config fixture override to inherit the value from deadline-cloud-test-fixture but modify only the parts necessary
  2. Modify the operating_system fixture to take its value from the OPERATING_SYSTEM environment variable

What is the impact of this change?

  1. There is less duplication of the worker_config fixture from the upstream deadline-cloud-test-fixtures package and we do not have to maintain synchronization of their logic
  2. Tests are simpler to write and do not need a combination of pytest parametrization and conditional skipping. Test authors only need to use test skipping

How was this change tested?

  1. Setup the environment with hatch env create
  2. Installed the mainline version of deadline-cloud-test-fixtures (includes aws-deadline/deadline-cloud-test-fixtures#164) into the hatch env:

    $ hatch shell
    (deadline-cloud-worker-agent) $ pip install git+https://github.com/aws-deadline/deadline-cloud-test-fixtures.git
  3. Ran the end-to-end tests.
    • Results pending...

Was this change documented?

Yes, updated test/e2e/README.md with updated documentation for writing os-specific tests.

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.

sonarcloud[bot] commented 1 hour ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud