serpapi / turbo_tests

Run RSpec tests on multiple cores. Like parallel_tests but with incremental summarized output. Originally extracted from the Discourse and Rubygems source code.
https://rubygems.org/gems/turbo_tests
MIT License
177 stars 27 forks source link

:x: (closable) Crash on : invalid byte sequence in US-ASCII #65

Open kriom opened 1 day ago

kriom commented 1 day ago

Hi,

First, thank for you great gem,

Lately I've had test runs crash with this error :

#<Thread:0x00007796efaa1678 /usr/local/bundle/bundler/gems/turbo_tests-aeae4ff0f18f/lib/turbo_tests/runner.rb:189 run> terminated with exception (report_on_exception is true):
/usr/local/bundle/bundler/gems/turbo_tests-aeae4ff0f18f/lib/turbo_tests/runner.rb:191:in `split': invalid byte sequence in US-ASCII (ArgumentError)

              result = line.split(env["RSPEC_FORMATTER_OUTPUT_ID"])
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    from /usr/local/bundle/bundler/gems/turbo_tests-aeae4ff0f18f/lib/turbo_tests/runner.rb:191:in `block (2 levels) in start_subprocess'
    from /usr/local/bundle/bundler/gems/turbo_tests-aeae4ff0f18f/lib/turbo_tests/runner.rb:190:in `each_line'
    from /usr/local/bundle/bundler/gems/turbo_tests-aeae4ff0f18f/lib/turbo_tests/runner.rb:190:in `block in start_subprocess'
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

It seems that turbo tests does not support my rspec output when it contains non US-ASCII caractères like "é" or "è"

How can we fix it ? Does this have anything to do with the local LC_ALL (en_US.UTF-8) displayed in the error output?

I'm going to continue looking into this problem, but if anyone knows what to do, I'd be happy to help.

Thanks !

kriom commented 19 hours ago

:x: Hi ! :x:

This issue can be closed ! I resolved my issue and it has nothing to see with turbo_tests.

To resolve it I had fix my locale in my Dockerfile

FROM ruby:3.3.6-bullseye as base
# ...
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
# ...
RUN apt-get update && apt-get install -y locales
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen en_US.UTF-8