Skip to content

Start moving ctlrender tests to CTest #114

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

Merged
merged 23 commits into from
Jan 21, 2023
Merged

Conversation

ThomasWilshaw
Copy link
Contributor

This PR is an experiment in moving the ctlrender tests from a bash script to CTest to make them more cross platform compatible.

@ThomasWilshaw
Copy link
Contributor Author

I'm not really sure why these tests are failing, It seems any time ctlrender is run via the CI with tiff files it fails and I can't work out why. I appreciate this might not be the way you want to go anyway but it seems worth pursuing.

@michaeldsmith
Copy link
Collaborator

the CI test without TIF works, but the others fail. I will look into why the other fail

image

@michaeldsmith
Copy link
Collaborator

running "Build" on the "RUN TESTS" project in Visual Studio works great, this is a big improvement

image

@michaeldsmith
Copy link
Collaborator

i get 100% tests pass in Ubuntu docker as well

image

@michaeldsmith
Copy link
Collaborator

@ThomasWilshaw does your PR include creating the output folder for the ctlrender conversions? In the existing test.sh, the output folder is created using
mkdir output

image

@ThomasWilshaw
Copy link
Contributor Author

No it doesn't actually, good spot. Are you thinking different libraries handle none existing folders differently?

@michaeldsmith
Copy link
Collaborator

michaeldsmith commented Jan 16, 2023

yeah, i think there may not be good handling of invalid input or output filenames. I added one message to exr_read() last month. It certainly helps for debugging to have a message on why something fails, rather than just silently failing.

@michaeldsmith
Copy link
Collaborator

michaeldsmith commented Jan 16, 2023

it looks like when I run ubuntu docker on my local system the output folder is copied over to the docker, which didn't result in failures yesterday, but if I remove it, then I get the failures just like the CI fails.

image

@michaeldsmith
Copy link
Collaborator

maybe a better approach would be to store the output files somewhere the \CTL\build directory or whatever build directory is used by CMake, instead of embedded in the \CTL\unittest\ctlrender directory ?

@michaeldsmith
Copy link
Collaborator

i added exception throwing to dpx_write(), now the dpx outputs also fail when output directory doesn't exist

image

@ThomasWilshaw
Copy link
Contributor Author

That seems ot have work pretty well. A new folder is created a build time in the unit test ctlrender subdirectory and all the outputs are stored in there. Most of the CI tests seem to be passing now.

@michaeldsmith
Copy link
Collaborator

it looks like docker fedora 35 failed for reasons unrelated to this, problems downloading. I'll re-run the failed job

image

@michaeldsmith
Copy link
Collaborator

michaeldsmith commented Jan 16, 2023

@ThomasWilshaw now that this approach seems to be working, can you also add the exr -> exr and tiff32->exr and exr->tiff32 tests from existing test.sh reproduced below ?

Also, since we discovered the silent failure for invalid filenames, it might be good to also have tests that we expect to fail included like you did for the ctlrender-ctl-function-name-is-incorrect test ? For invalid input filenames with DPX, TIFF and EXR format and for invalid output filenames for DPX, TIFF and EXR outtput. We may need to add additional ctlrender code to catch invalid filenames, maybe we could do that after we have invalid filename tests.

# test EXR to EXR support
if [[ $IS_OPENEXR_FOUND == 1 ]] ; then
	printf 'bars_photoshop.exr -> output/bars_exr_exr.exr \n'
	$CTLRENDER -ctl unity.ctl -format exr -force bars_photoshop.exr output/bars_exr_exr.exr
	printf 'bars_photoshop.exr -> output/bars_exr_exr16.exr \n'
	$CTLRENDER -ctl unity.ctl -format exr16 -force bars_photoshop.exr output/bars_exr_exr16.exr
	printf 'bars_photoshop.exr -> output/bars_exr_exr32.exr \n'
	$CTLRENDER -ctl unity.ctl -format exr32 -force bars_photoshop.exr output/bars_exr_exr32.exr

	# RGB tests
	printf 'colorbars_nuke_rgb_exr16.exr -> output/bars_rgb_exr16_to_exr16.exr \n'
	$CTLRENDER -force -format exr16 -ctl unity.ctl colorbars_nuke_rgb_exr16.exr output/bars_rgb_exr16_to_exr16.exr
	printf 'colorbars_nuke_rgb_exr16.exr -> output/bars_rgb_exr16_to_exr32.exr \n'
	$CTLRENDER -force -format exr32 -ctl unity.ctl colorbars_nuke_rgb_exr16.exr output/bars_rgb_exr16_to_exr32.exr
	printf 'colorbars_nuke_rgb_exr32.exr -> output/bars_rgb_exr32_to_exr16.exr \n'
	$CTLRENDER -force -format exr16 -ctl unity.ctl colorbars_nuke_rgb_exr32.exr output/bars_rgb_exr32_to_exr16.exr
	printf 'colorbars_nuke_rgb_exr32.exr -> output/bars_rgb_exr32_to_exr32.exr \n'
	$CTLRENDER -force -format exr32 -ctl unity.ctl colorbars_nuke_rgb_exr32.exr output/bars_rgb_exr32_to_exr32.exr

	# RGBA tests
	printf 'colorbars_nuke_rgba_exr16.exr -> output/bars_rgba_exr16_to_exr16.exr \n'
	$CTLRENDER -force -format exr16 -ctl unity_with_alpha.ctl colorbars_nuke_rgba_exr16.exr output/bars_rgba_exr16_to_exr16.exr
	printf 'colorbars_nuke_rgba_exr16.exr -> output/bars_rgba_exr16_to_exr32.exr \n'
	$CTLRENDER -force -format exr32 -ctl unity_with_alpha.ctl colorbars_nuke_rgba_exr16.exr output/bars_rgba_exr16_to_exr32.exr
	printf 'colorbars_nuke_rgba_exr32.exr -> output/bars_rgba_exr32_to_exr16.exr \n'
	$CTLRENDER -force -format exr16 -ctl unity_with_alpha.ctl colorbars_nuke_rgba_exr32.exr output/bars_rgba_exr32_to_exr16.exr
	printf 'colorbars_nuke_rgba_exr32.exr -> output/bars_rgba_exr32_to_exr32.exr \n'
	$CTLRENDER -force -format exr32 -ctl unity_with_alpha.ctl colorbars_nuke_rgba_exr32.exr output/bars_rgba_exr32_to_exr32.exr

fi

# test TIFF32 to EXR and EXR to TIFF32 support
if [[ $IS_OPENEXR_FOUND == 1 ]] && [[ $IS_TIFF_FOUND == 1 ]] ; then
	
	for J in exr exr16 exr32 tiff32; do

		for I in bars_photoshop_32_be_interleaved.tif bars_photoshop_32_be_planar.tif bars_photoshop_32_le_interleaved.tif bars_photoshop_32_le_planar.tif bars_photoshop.exr; do
			name=`echo $I | sed -e 's/\..*//'`
			ext=`echo $J | sed -e 's/[0-9]//g'`
			echo ${I} '->' ${J}
			if [[ $IS_TIFF_FOUND == 0 ]] && [[ $J == *"tif"* ]] ; then
				printf 'skipping %s because tiff support was not detected\n' $J
			elif [[ $IS_TIFF_FOUND == 0 ]] && [[ $I == *"tif"* ]] ; then
				printf 'skipping %s because tiff support was not detected\n' $I
			else
				$CTLRENDER -ctl unity.ctl -format ${J} -force ${I} output/${name}_${J}.${ext}
			fi

		done
	done
fi

@ThomasWilshaw
Copy link
Contributor Author

Yes I can add all that. I wanted to make sure things were working before I went too far.

@ThomasWilshaw
Copy link
Contributor Author

I've added all the requested tests. With regards to updating ctlrender's missing file code should that be a seperate PR to stop this one going to0 far out of scope?

@michaeldsmith
Copy link
Collaborator

I agree, lets get this PR merged and then add a check of invalid filename in dpx_read() in another PR, I added issue #122 to help track it

@michaeldsmith michaeldsmith marked this pull request as ready for review January 21, 2023 15:50
@michaeldsmith michaeldsmith merged commit 14eb346 into ampas:master Jan 21, 2023
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