-
Notifications
You must be signed in to change notification settings - Fork 36
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: squish gui submitter job bundle test suite #537
Open
rena-cheng
wants to merge
1
commit into
aws-deadline:mainline
Choose a base branch
from
rena-cheng:gui-submitter-test-suite
base: mainline
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
test/squish/deadline_gui_test_samples/job_bundle_one/asset_references.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
assetReferences: | ||
inputs: | ||
directories: | ||
- ./test_directory | ||
filenames: | ||
- ./mock_test_scene/squish_anim_test.txt | ||
outputs: | ||
directories: | ||
- ./output_images | ||
referencedPaths: [] |
8 changes: 8 additions & 0 deletions
8
test/squish/deadline_gui_test_samples/job_bundle_one/mock_test_scene/squish_anim_test.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{\rtf1\ansi\ansicpg1252\cocoartf2761 | ||
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;} | ||
{\colortbl;\red255\green255\blue255;} | ||
{\*\expandedcolortbl;;} | ||
\margl1440\margr1440\vieww11520\viewh8400\viewkind0 | ||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 | ||
|
||
\f0\fs24 \cf0 This is a test .txt file used in Squish automated testing for the GUI Submitters. } |
108 changes: 108 additions & 0 deletions
108
test/squish/deadline_gui_test_samples/job_bundle_one/template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
specificationVersion: 'jobtemplate-2023-09' | ||
name: GUI Submitter Testing - Job Bundle One | ||
description: | | ||
This is a custom job bundle created for the Squish Automated Test Suite which verifies the GUI Submitter UI. | ||
It is one of two custom job bundles created for the Squish Automated Test Suite. | ||
This is not intended for general use other than testing the GUI Submitter UI in Deadline Cloud CLI. | ||
|
||
parameterDefinitions: | ||
# Input Details | ||
- name: MockJobName | ||
type: STRING | ||
userInterface: | ||
control: LINE_EDIT | ||
label: Mock Job Name | ||
groupLabel: Mock Job Details | ||
default: Squish GUI Submitter Test - Job Bundle One | ||
description: Enter the name of the job. | ||
- name: Frames | ||
type: STRING | ||
userInterface: | ||
control: LINE_EDIT | ||
groupLabel: Mock Job Details | ||
default: 1-150 | ||
description: Enter the number of frames to test. | ||
- name: SquishMockSceneFile | ||
type: PATH | ||
objectType: FILE | ||
dataFlow: IN | ||
userInterface: | ||
control: CHOOSE_INPUT_FILE | ||
label: GUI Submitter Test File | ||
groupLabel: Mock Job Details | ||
default: "./mock_test_scene/squish_anim_test.txt" | ||
description: Choose the GUI Submitter file to run tests against. | ||
# Checkboxes | ||
- name: CheckBoxOne | ||
type: STRING | ||
userInterface: | ||
groupLabel: Custom Plugins | ||
control: CHECK_BOX | ||
label: Squish Custom Plugin | ||
default: "True" | ||
allowedValues: ["True", "False"] | ||
description: This checkbox defaults to "True". | ||
- name: CheckBoxTwo | ||
type: STRING | ||
userInterface: | ||
groupLabel: Custom Plugins | ||
control: CHECK_BOX | ||
label: Additional Squish Custom Plugin | ||
default: "False" | ||
allowedValues: ["True", "False"] | ||
description: This checkbox defaults to "False". | ||
# Output Details | ||
- name: OutputDir | ||
type: PATH | ||
objectType: DIRECTORY | ||
dataFlow: OUT | ||
userInterface: | ||
control: CHOOSE_DIRECTORY | ||
label: Output Directory | ||
groupLabel: Output Details | ||
default: "./output_images" | ||
description: Choose the GUI Submitter test output directory. | ||
- name: OutputPattern | ||
type: STRING | ||
userInterface: | ||
control: LINE_EDIT | ||
label: Output File Pattern | ||
groupLabel: Output Details | ||
default: "gui_submitter_output_####" | ||
description: Enter the output filename pattern (without extension). | ||
- name: Format | ||
type: STRING | ||
userInterface: | ||
control: DROPDOWN_LIST | ||
label: Output File Format | ||
groupLabel: Output Details | ||
description: Choose the file format to render as. | ||
default: OPEN_EXR | ||
allowedValues: [TGA, RAWTGA, JPEG, IRIS, IRIZ, PNG, HDR, TIFF, OPEN_EXR, OPEN_EXR_MULTILAYER, CINEON, DPX, DDS, JP2, WEBP] | ||
# Steps | ||
steps: | ||
- name: GUISubmitterTesting | ||
script: | ||
actions: | ||
onRun: | ||
command: bash | ||
args: ['{{Task.File.runScript}}'] | ||
embeddedFiles: | ||
- name: runScript | ||
type: TEXT | ||
data: | | ||
#!/usr/bin/env bash | ||
|
||
echo 'MockJobName value:' | ||
echo '{{Param.MockJobName}}' | ||
|
||
echo 'Frames value:' | ||
echo '{{Param.Frames}}' | ||
|
||
echo 'SquishMockSceneFile value:' | ||
echo '{{Param.SquishMockSceneFile}}' | ||
|
||
echo 'OutputDir value:' | ||
echo '{{Param.OutputDir}}' | ||
|
||
echo 'This completes the GUI Submitter Testing for Job Bundle One.' |
135 changes: 135 additions & 0 deletions
135
test/squish/deadline_gui_test_samples/job_bundle_two/template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
specificationVersion: 'jobtemplate-2023-09' | ||
name: GUI Submitter Testing - Job Bundle Two | ||
description: | | ||
This is a custom job bundle created for the Squish Automated Test Suite which verifies the GUI Submitter UI. | ||
It is two of two custom job bundles created for the Squish Automated Test Suite. | ||
This is not intended for general use other than testing the GUI Submitter UI in Deadline Cloud CLI. | ||
|
||
parameterDefinitions: | ||
# Input/Output Details | ||
- name: MockJobName | ||
type: PATH | ||
default: "gui_submitter_test.txt" | ||
objectType: FILE | ||
dataFlow: IN | ||
userInterface: | ||
control: CHOOSE_INPUT_FILE | ||
label: GUI Submitter Test File | ||
groupLabel: Render Parameters | ||
description: Select the mock scene file for running GUI Submitter Tests. | ||
- name: ResolutionX | ||
type: INT | ||
default: 1920 | ||
userInterface: | ||
control: SPIN_BOX | ||
label: Resolution X | ||
groupLabel: Render Parameters | ||
description: Enter the X resolution value | ||
- name: ResolutionY | ||
type: INT | ||
default: 1080 | ||
userInterface: | ||
control: SPIN_BOX | ||
label: Resolution Y | ||
groupLabel: Render Parameters | ||
description: Enter the Y resolution value | ||
- name: OutputDir | ||
type: PATH | ||
objectType: DIRECTORY | ||
dataFlow: OUT | ||
userInterface: | ||
control: CHOOSE_DIRECTORY | ||
label: Output Directory | ||
groupLabel: Output Details | ||
default: "./output_images" | ||
description: Choose the GUI Submitter test output directory. | ||
# Mock Settings - Float | ||
- name: FloatSpinner | ||
type: FLOAT | ||
userInterface: | ||
control: SPIN_BOX | ||
label: Depth of Field | ||
groupLabel: Depth of Field | ||
description: Mock Depth of Field Setting | ||
default: 100 | ||
- name: FloatSizeMaximum | ||
type: FLOAT | ||
userInterface: | ||
control: SPIN_BOX | ||
label: Maximum | ||
groupLabel: Depth of Field | ||
decimals: 1 | ||
description: Maximum float setting. | ||
default: 0.0 | ||
- name: FloatSizeMinimum | ||
type: FLOAT | ||
userInterface: | ||
control: SPIN_BOX | ||
label: Minimum | ||
groupLabel: Depth of Field | ||
decimals: 1 | ||
description: Minimum float setting | ||
default: 0.0 | ||
- name: FloatDropdown | ||
type: FLOAT | ||
userInterface: | ||
control: DROPDOWN_LIST | ||
label: Intensity | ||
groupLabel: Depth of Field | ||
description: Float values representing intensity. | ||
default: 0.0 | ||
allowedValues: [.25, .50, .75, 0.0, 1.0] | ||
# Other Mock Settingss | ||
- name: CameraFiltersStringDropdown | ||
type: STRING | ||
userInterface: | ||
control: DROPDOWN_LIST | ||
label: Camera Filters | ||
groupLabel: Other Settings | ||
description: Apply a camera filter | ||
default: "" | ||
allowedValues: ["", UV, POLARIZER, NEUTRAL DENSITY, DIFFUSION, INFRARED, DIOPTER] | ||
- name: MaskStringDropdown | ||
type: STRING | ||
userInterface: | ||
control: DROPDOWN_LIST | ||
label: Mask | ||
groupLabel: Other Settings | ||
description: Mask | ||
default: "" | ||
allowedValues: ["", rgba.red, rgba.green, rgba.blue, rgba.alpha] | ||
# Label | ||
- name: Label | ||
type: STRING | ||
userInterface: | ||
control: MULTILINE_EDIT | ||
label: Label | ||
groupLabel: Node | ||
default: "" | ||
# Steps | ||
steps: | ||
- name: GUISubmitterTesting | ||
script: | ||
actions: | ||
onRun: | ||
command: bash | ||
args: ['{{Task.File.runScript}}'] | ||
embeddedFiles: | ||
- name: runScript | ||
type: TEXT | ||
data: | | ||
#!/usr/bin/env bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as previous question. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Responded above. |
||
|
||
echo 'MockJobName value:' | ||
echo '{{Param.MockJobName}}' | ||
|
||
echo 'ResolutionX value:' | ||
echo '{{Param.ResolutionX}}' | ||
|
||
echo 'ResolutionY value:' | ||
echo '{{Param.ResolutionY}}' | ||
|
||
echo 'OutputDir value:' | ||
echo '{{Param.OutputDir}}' | ||
|
||
echo 'This completes the GUI Submitter Testing for Job Bundle Two.' |
76 changes: 76 additions & 0 deletions
76
test/squish/suite_deadline_gui/shared/scripts/choose_jobbundledir_helpers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# -*- coding: utf-8 -* | ||
# mypy: disable-error-code="attr-defined" | ||
|
||
import choose_jobbundledir_locators | ||
import gui_submitter_helpers | ||
import gui_submitter_locators | ||
import squish | ||
import test | ||
|
||
|
||
def launch_jobbundle_dir(): | ||
squish.startApplication("deadline bundle gui-submit --browse") | ||
test.log("Launched Choose Job Bundle Directory.") | ||
|
||
|
||
def select_jobbundle(filepath: str): | ||
# enter job bundle directory file path in directory text input | ||
squish.type( | ||
squish.waitForObject(choose_jobbundledir_locators.jobbundle_filepath_input), filepath | ||
) | ||
test.log("Entered job bundle file path in Choose Job Bundle Directory.") | ||
# verify text input appears | ||
test.compare( | ||
str( | ||
squish.waitForObjectExists( | ||
choose_jobbundledir_locators.jobbundle_filepath_input | ||
).displayText | ||
), | ||
filepath, | ||
"Expect job bundle file path to be input in dialogue.", | ||
) | ||
# hit 'choose' button | ||
test.log("Hitting 'Choose' button to open Submitter dialogue for selected job bundle.") | ||
squish.clickButton( | ||
squish.waitForObject(choose_jobbundledir_locators.choose_jobbundledir_button) | ||
) | ||
|
||
|
||
def load_different_job_bundle(): | ||
# click on job specific settings tab to navigate and ensure tests are on correct tab | ||
gui_submitter_helpers.navigate_job_specific_settings() | ||
# verify load different job bundle button exists and contains correct button text | ||
test.compare( | ||
str( | ||
squish.waitForObjectExists(gui_submitter_locators.load_different_job_bundle_button).text | ||
), | ||
"Load a different job bundle", | ||
"Expect Load a different job bundle button to contain correct text.", | ||
) | ||
# verify load a different job bundle button is enabled | ||
test.compare( | ||
squish.waitForObjectExists(gui_submitter_locators.load_different_job_bundle_button).enabled, | ||
True, | ||
"Expect Load a different job bundle button to be enabled.", | ||
) | ||
# click on load a different job bundle button | ||
test.log("Hitting `Load a different job bundle` button.") | ||
squish.clickButton( | ||
squish.waitForObject(gui_submitter_locators.load_different_job_bundle_button) | ||
) | ||
# verify Choose Job Bundle directory is open | ||
test.compare( | ||
str( | ||
squish.waitForObjectExists( | ||
choose_jobbundledir_locators.choose_job_bundle_dir | ||
).windowTitle | ||
), | ||
"Choose job bundle directory", | ||
"Expect Choose job bundle directory window title to be present.", | ||
) | ||
test.compare( | ||
squish.waitForObjectExists(choose_jobbundledir_locators.choose_job_bundle_dir).visible, | ||
True, | ||
"Expect Choose job bundle directory to be open.", | ||
) |
31 changes: 31 additions & 0 deletions
31
test/squish/suite_deadline_gui/shared/scripts/choose_jobbundledir_locators.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# -*- coding: utf-8 -*- | ||
|
||
# choose job bundle directory | ||
choose_job_bundle_dir = {"name": "QFileDialog", "type": "QFileDialog", "visible": 1} | ||
directory_text_label = { | ||
"name": "fileNameLabel", | ||
"type": "QLabel", | ||
"visible": 1, | ||
"window": choose_job_bundle_dir, | ||
} | ||
jobbundle_filepath_input = { | ||
"buddy": directory_text_label, | ||
"name": "fileNameEdit", | ||
"type": "QLineEdit", | ||
"visible": 1, | ||
} | ||
choose_jobbundledir_button = { | ||
"text": "Choose", | ||
"type": "QPushButton", | ||
"unnamed": 1, | ||
"visible": 1, | ||
"window": choose_job_bundle_dir, | ||
} | ||
jobbundledir_cancel_button = { | ||
"text": "Cancel", | ||
"type": "QPushButton", | ||
"unnamed": 1, | ||
"visible": 1, | ||
"window": choose_job_bundle_dir, | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the embedded script have a
set -euo
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't it's necessary given how simple my script is ('echo' is a very simple command (and almost never fails).
Maybe the only reason to add it is to add consistency across all the Deadline Cloud Job Bundles that have been written, but I noticed some do NOT have
set -euo
added, including GUI Control Showcase which I've referenced: https://github.com/aws-deadline/deadline-cloud-samples/blob/mainline/job_bundles/gui_control_showcase/template.yamlSo I think for now I will exclude it!