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

[apple] 2 test result files with different names. Can't assign a fix file name (eg. TestResult.xml) #983

Open
nayanbhagowaty opened this issue Jan 5, 2023 · 8 comments

Comments

@nayanbhagowaty
Copy link

Not able to generate a fix file name test result. I might be missing something in apple. Works fine in android. Command i use is
xharness apple test --app=myApp.app --output-directory=./temp --target=ios-simulator-64

@premun
Copy link
Member

premun commented Jan 5, 2023

Can you elaborate on what you mean by "generate a fix file name test result"?

Can you share output of the XHarness command?

@nayanbhagowaty
Copy link
Author

nayanbhagowaty commented Jan 5, 2023

Hi @premun,
Below is my output in the temp folder when I run the apple test command above. Last 2 files are duplicate. What I want is a single test result file (great if, user defined filename) that my build server can uniquely identify.

-rw-r--r--   1   staff   333811 Jan  5 13:41 list-ios-simulator-64-20230105_134126.log
-rw-r--r--   1   staff   802824 Jan  5 13:47 test-ios-simulator-64-20230105_134131.log
-rw-r--r--   1   staff  2286059 Jan  5 13:47 test-ios-simulator-64.log
-rw-r--r--   1   staff   802825 Jan  5 13:47 xunit-test-ios-simulator-64-20230105_134131-20230105_134729.xml
-rw-r--r--   1   staff   802825 Jan  5 13:47 xunit-test-ios-simulator-64-20230105_134131.xml

@premun
Copy link
Member

premun commented Jan 5, 2023

Can you please run the command with --debug and share the command line output (stdout/err) of the command?

@nayanbhagowaty
Copy link
Author

Need to be appended in the same command?
xharness apple test --app=myApp.app --output-directory=./temp --target=ios-simulator-64 --debug
fail: Unknown arguments: --debug

@premun
Copy link
Member

premun commented Jan 5, 2023

Ah, apologies, it's -v not --debug

@nayanbhagowaty
Copy link
Author

Here's the log
iostestoutput_.log

@premun
Copy link
Member

premun commented Jan 5, 2023

I am not sure why it creates two of those. I suppose you have cleaned the folder between different runs?

I can see that in our builds, we do this:

# Rename test result XML so that AzDO reporter recognizes it
test_results=$(ls "$output_directory"/xunit-*.xml)
if [ -f "$test_results" ]; then
    echo "Found test results in $test_results. Renaming to testResults.xml to prepare for Helix upload"

    # Prepare test results for Helix to pick up
    mv "$test_results" "$output_directory/testResults.xml"
fi

@nayanbhagowaty
Copy link
Author

nayanbhagowaty commented Jan 5, 2023

Yes. it is a clean build on an empty directory. I will do the same & continue investigating then.
Thanks for having a look.

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

No branches or pull requests

2 participants