aws-deadline / deadline-cloud-for-cinema-4d

AWS Deadline Cloud for Cinema 4D
Apache License 2.0
9 stars 12 forks source link

test: add plain text job_bundle_output_tests #77

Closed gp-dan closed 3 weeks ago

gp-dan commented 4 weeks ago

5 test scenes implemented as python scripts and respective job bundles:

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

Example scenes and respective expected job bundle outputs

What was the solution? (How)

Plain text py files to generate scenes and their respective job bundle outputs with normalized paths

What is the impact of this change?

Developers have a common set of test scenes

How was this change tested?

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.

karthikbekalp commented 3 weeks ago

Hmm, sorry my bad. Looks like the SonarCloud checks still failed because it detected duplicate code amongst all the tests. Can you move the duplicate code into a separate util function in the test package so that we can eliminate this issue?

karthikbekalp commented 3 weeks ago

But the linting has failed so there's a need to reformat the code anyway. https://github.com/aws-deadline/deadline-cloud-for-cinema-4d/actions/runs/11564466263/job/32191091030?pr=77 Can you please run

# For fixing the formatting
hatch run fmt

# Add the formatted files
git add ...

# Amend your commit
git commit --amend

# Force push the amended commit
git push --force-with-lease <remote_name> gp-dan:job_bundle_output_tests
gp-dan commented 3 weeks ago

Thanks @karthikbekalp I intentionally kept the duplication as I was trying to make a clean plain text equivalent of a static .c4d scene description. if we factor out the duplicated lines the scripts will no longer be static scene descriptions but programs that require a util library to run. You'll need to add the util library to the environment before running Extensions > User Scripts > Run Script ... The scenes will no longer be strictly reproducible and self contained tests as the scene descriptions now depend on a utility function that may change and affect all scenes and complicate finding regressions. Could we configure the CI to ignore the duplication requirement on job_bundle_output_tests dir to avoid adding the extra complexity? What do you think?

karthikbekalp commented 3 weeks ago

Thanks for your clarification. It looks like we can override and merge even if the SonarCloud checks failed.

sonarcloud[bot] commented 3 weeks ago

Quality Gate Failed Quality Gate failed

Failed conditions
3.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud