diff options
author | Kristina Chodorow <kchodorow@google.com> | 2016-09-22 17:37:49 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2016-09-22 17:53:11 +0000 |
commit | 296ffbde796f00c7a493330089085f9be1442f0b (patch) | |
tree | 332103207eb7b52c1229f4e33c0d7ca96522dc8d /src/test/java/com/google/devtools/build/lib/rules/repository/CompressedTarFunctionTest.java | |
parent | cebb7522cac6a245a491ebf7a323d8e793bb0ef1 (diff) |
Rollback of commit 4e2f75d8e60020f13a7df452488ec4cc7a719f03.
*** Reason for rollback ***
This is causing external_integration_test to fail
See, for example, http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=linux-x86_64/236/console:
** test_http_archive_tar_xz ****************************************************
GET /fox.tar.xz HTTP/1.1
User-Agent: Java/1.8.0_101
Host: localhost:36541
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
cat: bazel-out/../external/endangered/fox/male_absolute: No such file or directory
-- Test log: -----------------------------------------------------------
INFO: Reading 'startup' options from /home/ci/.cache/bazel/_bazel_ci/a761298a0949227106f79c62c3bebb6e/bazel-sandbox/81f51af6-eb50-417e-8f8d-b7bba207ee83-661/execroot/linux-x86_64/_tmp/external_integration_test_2/bazelrc: --output_user_root=/home/ci/.cache/bazel/_bazel_ci/a761298a0949227106f79c62c3bebb6e/bazel-sandbox/81f51af6-eb50-417e-8f8d-b7bba207ee83-661/execroot/linux-x86_64/_tmp/external_integration_test_2/root --host_javabase=/home/ci/.cache/bazel/_bazel_ci/a761298a0949227106f79c62c3bebb6e/bazel-sandbox/81f51af6-eb50-417e-8f8d-b7bba207ee83-661/execroot/linux-x86_64/bazel-out/local-fastbuild/bin/src/test/shell/bazel/external_integration_test.runfiles/local_jdk
INFO: $TEST_TMPDIR defined: output root default is '/home/ci/.cache/bazel/_bazel_ci/a761298a0949227106f79c62c3bebb6e/bazel-sandbox/81f51af6-eb50-417e-8f8d-b7bba207ee83-661/execroot/linux-x86_64/_tmp/external_integration_test_2'.
..............................................
____Loading package: zoo
____Loading...
____Loading package: @bazel_tools//tools/cpp
____Loading package: @bazel_tools//tools/jdk
____Loading package: @local_config_xcode//
____Loading package: @local_jdk//
____Loading package: @local_config_cc//
____Loading complete. Analyzing...
____Downloading from [] 0B
____Downloading from [] 1KB
____Loading package: @endangered//fox
____Found 1 target...
____Building...
____[0 / 1] BazelWorkspaceStatusAction stable-status.txt
____[0 / 4] Creating source manifest for //zoo:breeding-program
____[0 / 4] Symlinking //zoo:breeding-program
____[3 / 4] Creating runfiles tree bazel-out/local-fastbuild/bin/zoo/breeding-program.runfiles
____Building complete.
Target //zoo:breeding-program up-to-date:
bazel-bin/zoo/breeding-program
____Elapsed time: 6.903s, Critical Path: 0.04s
____Running command line: bazel-bin/zoo/breeding-program
Fraka-kaka-kaka-kaka-kow
------------------------------------------------------------------------
test_http_archive_tar_xz FAILED: Expected regexp #!/bin/bash
echo Fraka-kaka-kaka-kaka-kow not found in bazel-out/../external/endangered/fox/male_absolute .
/home/ci/.cache/bazel/_bazel_ci/a761298a0949227106f79c62c3bebb6e/bazel-sandbox/81f51af6-eb50-417e-8f8d-b7bba207ee83-661/execroot/linux-x86_64/bazel-out/local-fastbuild/bin/src/test/shell/bazel/external_integration_test.runfiles/io_bazel/src/test/shell/bazel/external_integration_test:154: in call to assert_files_same
/home/ci/.cache/bazel/_bazel_ci/a761298a0949227106f79c62c3bebb6e/bazel-sandbox/81f51af6-eb50-417e-8f8d-b7bba207ee83-661/execroot/linux-x86_64/bazel-out/local-fastbuild/bin/src/test/shell/bazel/external_integration_test.runfiles/io_bazel/src/test/shell/bazel/external_integration_test:150: in call to http_archive_helper
/home/ci/.cache/bazel/_bazel_ci/a761298a0949227106f79c62c3bebb6e/bazel-sandbox/81f51af6-eb50-417e-8f8d-b7bba207ee83-661/execroot/linux-x86_64/bazel-out/local-fastbuild/bin/src/test/shell/bazel/external_integration_test.runfiles/io_bazel/src/test/shell/bazel/external_integration_test:190: in call to test_http_archive_tar_xz
FAILED: test_http_archive_tar_xz
*** Original change description ***
Fixed symbolic link and hard link path not stripped when "strip_prefix" is set.
--
MOS_MIGRATED_REVID=133970692
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/repository/CompressedTarFunctionTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/repository/CompressedTarFunctionTest.java | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/repository/CompressedTarFunctionTest.java b/src/test/java/com/google/devtools/build/lib/rules/repository/CompressedTarFunctionTest.java index 35305da87f..b638b21052 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/repository/CompressedTarFunctionTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/repository/CompressedTarFunctionTest.java @@ -54,8 +54,6 @@ public class CompressedTarFunctionTest { private static final String PATH_TO_TEST_ARCHIVE = "/com/google/devtools/build/lib/rules/repository/"; - private static final String ROOT_FOLDER_NAME = "root_folder"; - /* Tarball, created by * tar -czf <ARCHIVE_NAME> <REGULAR_FILE_NAME> <HARD_LINK_FILE_NAME> <SYMBOLIC_LINK_FILE_NAME> */ @@ -88,36 +86,12 @@ public class CompressedTarFunctionTest { } /** - * Test decompressing a tar.gz file with hard link file and symbolic link file inside without - * stripping a prefix - * - * @throws Exception - */ - @Test - public void testDecompressWithoutPrefix() throws Exception { - - Path outputDir = - new CompressedTarFunction() { - @Override - protected InputStream getDecompressorStream(DecompressorDescriptor descriptor) - throws IOException { - return new GZIPInputStream(new FileInputStream(descriptor.archivePath().getPathFile())); - } - }.decompress(descriptorBuilder.build()); - - assertOutputFiles(outputDir.getRelative(ROOT_FOLDER_NAME)); - } - - /** - * Test decompressing a tar.gz file with hard link file and symbolic link file inside and - * stripping a prefix + * Test decompressing a tar.gz file with hard link file and symbolic link file inside * * @throws Exception */ @Test - public void testDecompressWithPrefix() throws Exception { - - descriptorBuilder.setPrefix(ROOT_FOLDER_NAME); + public void testDecompress() throws Exception { Path outputDir = new CompressedTarFunction() { @@ -128,14 +102,6 @@ public class CompressedTarFunctionTest { } }.decompress(descriptorBuilder.build()); - assertOutputFiles(outputDir); - } - - /** - * Validate the content of the output directory - */ - private void assertOutputFiles(Path outputDir) throws Exception { - assertThat(outputDir.exists()).isTrue(); assertThat(outputDir.getRelative(REGULAR_FILE_NAME).exists()).isTrue(); assertThat(outputDir.getRelative(REGULAR_FILE_NAME).getFileSize()).isNotEqualTo(0); |