google / googletest

GoogleTest - Google Testing and Mocking Framework
https://google.github.io/googletest/
BSD 3-Clause "New" or "Revised" License
34.93k stars 10.16k forks source link

test was pass,but [ FATAL ] external/com_google_googletest/googletest/src/gtest.cc:194:: Unable to open file "text.xml" #3423

Open kekxv opened 3 years ago

kekxv commented 3 years ago

test was pass,but [ FATAL ] external/com_google_googletest/googletest/src/gtest.cc:194:: Unable to open file "text.xml"

use i686-w64-mingw32-

➜  worker i686-w64-mingw32-gcc -v
Using built-in specs.
COLLECT_GCC=i686-w64-mingw32-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-w64-mingw32/9.3-posix/lto-wrapper
Target: i686-w64-mingw32
Configured with: ../../src/configure --build=x86_64-linux-gnu --prefix=/usr --includedir='/usr/include' --mandir='/usr/share/man' --infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir='/usr/lib/x86_64-linux-gnu' --libexecdir='/usr/lib/x86_64-linux-gnu' --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --enable-shared --enable-static --disable-multilib --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --libdir=/usr/lib --enable-libstdcxx-time=yes --with-tune=generic --with-headers=/usr/i686-w64-mingw32/include --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libgomp --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-lto --enable-threads=posix --program-suffix=-posix --program-prefix=i686-w64-mingw32- --target=i686-w64-mingw32 --with-as=/usr/bin/i686-w64-mingw32-as --with-ld=/usr/bin/i686-w64-mingw32-ld --enable-libatomic --enable-libstdcxx-filesystem-ts=yes --enable-dependency-tracking
Thread model: posix
gcc version 9.3-posix 20200320 (GCC)
➜  worker i686-w64-mingw32-g++ -v
Using built-in specs.
COLLECT_GCC=i686-w64-mingw32-g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-w64-mingw32/9.3-posix/lto-wrapper
Target: i686-w64-mingw32
Configured with: ../../src/configure --build=x86_64-linux-gnu --prefix=/usr --includedir='/usr/include' --mandir='/usr/share/man' --infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir='/usr/lib/x86_64-linux-gnu' --libexecdir='/usr/lib/x86_64-linux-gnu' --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --enable-shared --enable-static --disable-multilib --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --libdir=/usr/lib --enable-libstdcxx-time=yes --with-tune=generic --with-headers=/usr/i686-w64-mingw32/include --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libgomp --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-lto --enable-threads=posix --program-suffix=-posix --program-prefix=i686-w64-mingw32- --target=i686-w64-mingw32 --with-as=/usr/bin/i686-w64-mingw32-as --with-ld=/usr/bin/i686-w64-mingw32-ld --enable-libatomic --enable-libstdcxx-filesystem-ts=yes --enable-dependency-tracking
Thread model: posix
gcc version 9.3-posix 20200320 (GCC)
➜  worker
bazel test --tool_tag=ijwb:CLion --curses=no --color=yes --progress_in_terminal_title=no --runs_per_test=1 --flaky_test_attempts=1 --build_event_binary_file=/var/folders/f6/dtcmrp9x1xdf5lhbng47dr300000gn/T/intellij-bep-22ad133f-3047-4754-9956-c7279a7e8244 --nobuild_event_binary_file_path_conversion -- //Basic/cpp-base64:cpp-base64-test
Testing started at 4:35 下午 ...
INFO: Invocation ID: eb9c950d-2e50-41e6-b4c4-223a41f1c255
Loading: 
Loading: 0 packages loaded
Analyzing: target //Basic/cpp-base64:cpp-base64-test (1 packages loaded, 0 targets configured)
INFO: Analyzed target //Basic/cpp-base64:cpp-base64-test (1 packages loaded, 5 targets configured).
INFO: Found 1 test target...
[0 / 6] [Prepa] BazelWorkspaceStatusAction stable-status.txt
[4 / 7] Compiling Basic/cpp-base64/test/test-google.cpp; 0s remote ... (2 actions running)
[6 / 7] Linking Basic/cpp-base64/cpp-base64-test.exe; 1s remote
[7 / 8] [Prepa] Testing //Basic/cpp-base64:cpp-base64-test
[7 / 8] Testing //Basic/cpp-base64:cpp-base64-test; 1s remote
[7 / 8] Testing //Basic/cpp-base64:cpp-base64-test; 3s remote
FAIL: //Basic/cpp-base64:cpp-base64-test (see /private/var/tmp/_bazel_caesar/70ee8c04188240ae82aa4f6ef5494dd3/execroot/TerminalService/bazel-out/mingw32-fastbuild/testlogs/Basic/cpp-base64/cpp-base64-test/test.log)
Target //Basic/cpp-base64:cpp-base64-test up-to-date:
  bazel-bin/Basic/cpp-base64/cpp-base64-test.exe
INFO: Elapsed time: 9.128s, Critical Path: 8.86s
INFO: 8 processes: 2 internal, 6 remote.
INFO: Build completed, 1 test FAILED, 8 total actions
//Basic/cpp-base64:cpp-base64-test                                       FAILED in 3.9s
  /private/var/tmp/_bazel_caesar/70ee8c04188240ae82aa4f6ef5494dd3/execroot/TerminalService/bazel-out/mingw32-fastbuild/testlogs/Basic/cpp-base64/cpp-base64-test/test.log

Executed 1 out of 1 test: 1 fails remotely.
INFO: Build completed, 1 test FAILED, 8 total actions
INFO: Build Event Protocol files produced successfully.
INFO: Build completed, 1 test FAILED, 8 total actions

exited with error code 3

Generated test.log (if the file is not UTF-8, then this may be unreadable):
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //Basic/cpp-base64:cpp-base64-test
-----------------------------------------------------------------------------
Running main() from gmock_main.cc
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from Base64
[ RUN      ] Base64.encode
encoded: 
UmVuw6kgTnlmZmVuZWdnZXIKaHR0cDovL3d3dy5yZW5lbnlmZmVuZWdnZXIuY2gKcGFzc2lvbiBmb3IgZGF0YQo=

decoded: 
René Nyffenegger
http://www.renenyffenegger.ch
passion for data

encoded:   YWJj
reference: YWJj
decoded:   abc

encoded:   YWJjZA==
reference: YWJjZA==
decoded:   abcd

encoded:   YWJjZGU=
reference: YWJjZGU=
decoded:   abcde

[       OK ] Base64.encode (0 ms)
[----------] 1 test from Base64 (0 ms total)

[----------] Global test environment tear-down

[ FATAL ] external/com_google_googletest/googletest/src/gtest.cc:194:: Unable to open file "Z:\tmp\worker\default_memory_instance\operations\a464338e-7749-4d40-8f11-b2e4c0d89915\bazel-out\mingw32-fastbuild\bin\Basic\cpp-base64\cpp-base64-test.exe.runfiles\TerminalService\tmp\worker\default_memory_instance\operations\a464338e-7749-4d40-8f11-b2e4c0d89915\bazel-out\mingw32-fastbuild\testlogs\Basic\cpp-base64\cpp-base64-test\test.xml"
derekmauro commented 3 years ago

We need complete instructions on how you setup your environment before we can look into this.

kekxv commented 3 years ago

buildfarm.example.com:8980 is [https://github.com/bazelbuild/bazel-buildfarm](https://github.com/bazelbuild/bazel-buildfarm) on ubuntu and install mingw-w64 like apt install mingw-w64 -y

test file :

cpp-base64.tar.gz

# com_google_googletest
http_archive(
    name = "com_google_googletest",
    strip_prefix = "googletest-release-1.10.0",
    url = "https://github.com/google/googletest/archive/release-1.10.0.tar.gz",
    sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb",
)
  cpp-base64 bazel test //...
INFO: Invocation ID: d6c9e1bd-7e09-4b32-9fa5-e29d814b42f7
INFO: Build options --cpu, --crosstool_top, and --run_under have changed, discarding analysis cache.
INFO: Analyzed 11 targets (0 packages loaded, 619 targets configured).
INFO: Found 10 targets and 1 test target...
FAIL: //:cpp-base64-test (see /private/var/tmp/_bazel_caesar/839a9831350a6e0f7600951b0b45d845/execroot/cpp-base64/bazel-out/mingw32-fastbuild/testlogs/cpp-base64-test/test.log)
INFO: Elapsed time: 16.876s, Critical Path: 15.86s
INFO: 24 processes: 16 remote cache hit, 2 internal, 6 remote.
INFO: Build completed, 1 test FAILED, 24 total actions
//:cpp-base64-test                                                       FAILED in 1.5s
  /private/var/tmp/_bazel_caesar/839a9831350a6e0f7600951b0b45d845/execroot/cpp-base64/bazel-out/mingw32-fastbuild/testlogs/cpp-base64-test/test.log

INFO: Build completed, 1 test FAILED, 24 total actions
  cpp-base64 cat /private/var/tmp/_bazel_caesar/839a9831350a6e0f7600951b0b45d845/execroot/cpp-base64/bazel-out/mingw32-fastbuild/testlogs/cpp-base64-test/test.log
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //:cpp-base64-test
-----------------------------------------------------------------------------
Running main() from gmock_main.cc
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from Base64
[ RUN      ] Base64.encode
encoded:
UmVuw6kgTnlmZmVuZWdnZXIKaHR0cDovL3d3dy5yZW5lbnlmZmVuZWdnZXIuY2gKcGFzc2lvbiBmb3IgZGF0YQo=

decoded:
René Nyffenegger
http://www.renenyffenegger.ch
passion for data

encoded:   YWJj
reference: YWJj
decoded:   abc

encoded:   YWJjZA==
reference: YWJjZA==
decoded:   abcd

encoded:   YWJjZGU=
reference: YWJjZGU=
decoded:   abcde

[       OK ] Base64.encode (0 ms)
[----------] 1 test from Base64 (0 ms total)

[----------] Global test environment tear-down

[ FATAL ] external/com_google_googletest/googletest/src/gtest.cc:194:: Unable to open file "Z:\tmp\worker\default_memory_instance\operations\28ca6321-cf4c-4e91-badf-4dceeb537615\bazel-out\mingw32-fastbuild\bin\cpp-base64-test.exe.runfiles\cpp-base64\tmp\worker\default_memory_instance\operations\28ca6321-cf4c-4e91-badf-4dceeb537615\bazel-out\mingw32-fastbuild\testlogs\cpp-base64-test\test.xml"
  cpp-base64
  cpp-base64 cat .bazelrc
build:remote            --remote_executor=grpc://buildfarm.example.com:8980
build:remote            --remote_cache=grpc://buildfarm.example.com:8980

build:localhost_remote  --remote_executor=grpc://localhost:8980
build:localhost_remote  --remote_cache=grpc://localhost:8980

build:rpi               --crosstool_top=//toolchain:clang_suite
build:rpi               --cpu=armv7hf
build:rpi               --host_crosstool_top=@bazel_tools//tools/cpp:toolchain

build:ubuntu            --crosstool_top=//toolchain:clang_suite
build:ubuntu            --cpu=k8
build:ubuntu            --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
build:ubuntu_remote     --config=remote
build:ubuntu_remote     --config=ubuntu

build:mingw32           --crosstool_top=//toolchain:clang_suite
build:mingw32           --cpu=mingw32
build:mingw32           --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
test:mingw32            --run_under=wine
run:mingw32             --run_under=wine

build:mingw32_remote    --config=remote
build:mingw32_remote    --config=mingw32

# build                   --config=ubuntu_remote
build                   --config=mingw32_remote
GoutamD2905 commented 1 month ago

Is there any fix for this issue? Because we are unable to mock fopen calls for test cases.