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

Fix desktop test searching #23793

Merged
merged 3 commits into from
Jan 9, 2018
Merged

Fix desktop test searching #23793

merged 3 commits into from
Jan 9, 2018

Conversation

jaredpar
Copy link
Member

Not all of our desktop tests have a target framework directory in their
paths. Only the ones which also multi-target do. For the time being
changing the set of DLLs that we run on Mono to be a hard coded list as
it's only two. Will expand out as we increase our scope.

@jaredpar jaredpar requested a review from khyperia December 14, 2017 22:04
@jaredpar jaredpar requested a review from a team as a code owner December 14, 2017 22:04
@@ -20,10 +20,15 @@ xunit_console_version="$(get_package_version dotnet-xunit)"

if [[ "${runtime}" == "dotnet" ]]; then
target_framework=netcoreapp2.0
dir_list="${unittest_dir}"/*/netcoreapp2.0/*.UnitTests.dll
Copy link
Contributor

Choose a reason for hiding this comment

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

I would probably prefer:

dir_list=( "${unittest_dir}"/*/netcoreapp2.0/*.UnitTests.dll )

and for file_name in "${dir_list[@]}" (and removal of dir_list="${unittest_dll_list[@]}").

The way you have it now is susceptible to spaces in paths, I think - or at least really confusing (I don't think variable assignments expand globs, so the expansion is happening at for-loop-time - while being a statically known list for mono. Using an array (my preference above) makes the expansion happen at declaration-time)

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, how does this work in the first place?? My testing:

khyperia@carbon ~ i % foo=*
khyperia@carbon ~ i % echo $foo
*
khyperia@carbon ~ i % for x in $foo; do; echo $x; done
*
khyperia@carbon ~ i % bar=( * )
khyperia@carbon ~ i % echo $bar
file1 file2 file3
khyperia@carbon ~ i % for x in "${bar[@]}"; do; echo $x; done
file1
file2
file3
khyperia@carbon ~ i %

Copy link
Contributor

Choose a reason for hiding this comment

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

The variable should also probably be called file_list as well

target_framework=net461
unittest_dll_list=(
"${unittest_dir}/CSharpCompilerSymbolTest/net461/Roslyn.Compilers.CSharp.Symbol.UnitTests.dll"
"${unittest_dir}/CSharpCompilerSyntaxTest/net461/Roslyn.Compilers.CSharp.Syntax.UnitTests.dll"
Copy link
Contributor

@khyperia khyperia Dec 14, 2017

Choose a reason for hiding this comment

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

I'm guessing this is the static list of what dlls were actually running (positive list instead of negative list). Good to keep in mind for the future.

Edit: never mind, I'm dumb, didn't read the description :)

Not all of our desktop tests have a target framework directory in their
paths. Only the ones which also multi-target do. For the time being
changing the set of DLLs that we run on Mono to be a hard coded list as
it's only two. Will expand out as we increase our scope.
xunit_console="${nuget_dir}"/dotnet-xunit/"${xunit_console_version}"/tools/${target_framework}/xunit.console.dll
elif [[ "${runtime}" == "mono" ]]; then
source ${root_path}/build/scripts/obtain_mono.sh
target_framework=net461
unittest_dll_list=(
Copy link
Member

Choose a reason for hiding this comment

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

Where is this variable used?

Copy link
Member Author

Choose a reason for hiding this comment

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

Blarg ... so basic of a mistake ...

Copy link
Member

@agocke agocke left a comment

Choose a reason for hiding this comment

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

LGTM

@jaredpar jaredpar merged commit 451e54f into dotnet:master Jan 9, 2018
@jaredpar jaredpar deleted the fix-mono branch January 9, 2018 17:36
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.

3 participants