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

Error when running xcode-project run-tests tool (models/xctests/converter.py): could not convert string to float #432

Closed
sergiymomot opened this issue Oct 28, 2024 · 4 comments · Fixed by #433
Labels
bug Something isn't working

Comments

@sergiymomot
Copy link

Hey, we encountered ValueError: could not convert string to float: '1m 4' error when using xcode-project run-tests CLI tool
Seems to only happen when tests succeed.

Xcode version: 16.0
Failed Workflow ID if it helps: 671fb636267ec43c813905f2

[16:18:13 28-10-2024] WARNING cli_app.py:135 > �[31mExecuting "xcode-project run-tests" failed unexpectedly. Detailed logs are available at "/var/folders/w2/rrf5p87d1bbfyphxc7jdnyvh0000gn/T/codemagic-28-10-24.log". �[0m
[16:18:13 28-10-2024] ERROR cli_app.py:137 > Exception traceback:
Traceback (most recent call last):
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/cli/cli_app.py", line 243, in invoke_cli
    CliApp._running_app._invoke_action(args)
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/cli/cli_app.py", line 184, in _invoke_action
    return cli_action(**action_args)
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/cli/action.py", line 83, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/tools/xcode_project.py", line 506, in run_test
    test_suites, xcresult = self._get_test_suites(
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/tools/xcode_project.py", line 766, in _get_test_suites
    test_suites = XcResultConverter.xcresult_to_junit(xcresult)
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/models/xctests/converter.py", line 56, in xcresult_to_junit
    return cls(xcresult).convert()
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/models/xctests/converter.py", line 333, in convert
    test_suites = [
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/models/xctests/converter.py", line 334, in <listcomp>
    self._get_test_suite(xc_test_suite_node, xc_summary)
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/models/xctests/converter.py", line 320, in _get_test_suite
    time=sum(cls._get_test_node_duration(xc_test_case) for xc_test_case in xc_test_cases),
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/models/xctests/converter.py", line 320, in <genexpr>
    time=sum(cls._get_test_node_duration(xc_test_case) for xc_test_case in xc_test_cases),
  File "/Users/builder/.pyenv/versions/3.8.13/lib/python3.8/site-packages/codemagic/models/xctests/converter.py", line 251, in _get_test_node_duration
    return float(duration)
ValueError: could not convert string to float: '1m 4'
[16:18:13 28-10-2024] DEBUG cli_app.py:286 > �[35m------------------------------------------------------------�[0m
[16:18:13 28-10-2024] DEBUG cli_app.py:287 > �[35mCompleted XcodeProject run-tests in 08:51 with status code 9�[0m
[16:18:13 28-10-2024] DEBUG cli_app.py:288 > �[35m------------------------------------------------------------�[0m
@sergiymomot
Copy link
Author

@priitlatt Seems related to this change: #431 (comment)

@priitlatt
Copy link
Contributor

@sergiymomot thanks for reporting this! I'll look into it tomorrow and let you know once we have a fix in place.

@priitlatt priitlatt added the bug Something isn't working label Oct 28, 2024
@priitlatt
Copy link
Contributor

@sergiymomot Fix for this was just released in v0.54.1. Sorry for the trouble.

@sergiymomot
Copy link
Author

@priitlatt confirming the fix. Thanks for the quick turnaround time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants