[llvm] 038b9ed - [llvm] [Debuginfod] Remove `llvm-debuginfod-find` lit tests that used python http server.

Noah Shutty via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 18:33:18 PDT 2022


Author: Noah Shutty
Date: 2022-08-30T01:32:34Z
New Revision: 038b9ed3952a240fec0432d66d7b4b2926a330bc

URL: https://github.com/llvm/llvm-project/commit/038b9ed3952a240fec0432d66d7b4b2926a330bc
DIFF: https://github.com/llvm/llvm-project/commit/038b9ed3952a240fec0432d66d7b4b2926a330bc.diff

LOG: [llvm] [Debuginfod] Remove `llvm-debuginfod-find` lit tests that used python http server.

These tests depend on `ThreadingHTTPServer` which was not introduced until python 3.7 so we might as well delete them to avoid issues. Most of their functionality is now covered by the llvm-debuginfod.test for the debuginfod server.

Reviewed By: mysterymath

Differential Revision: https://reviews.llvm.org/D119096

Added: 
    

Modified: 
    

Removed: 
    llvm/test/tools/llvm-debuginfod-find/Inputs/buildid/abcdef/debuginfo
    llvm/test/tools/llvm-debuginfod-find/Inputs/buildid/abcdef/executable
    llvm/test/tools/llvm-debuginfod-find/Inputs/buildid/abcdef/source/directory/file.c
    llvm/test/tools/llvm-debuginfod-find/debuginfod.test


################################################################################
diff  --git a/llvm/test/tools/llvm-debuginfod-find/Inputs/buildid/abcdef/debuginfo b/llvm/test/tools/llvm-debuginfod-find/Inputs/buildid/abcdef/debuginfo
deleted file mode 100644
index cf84226721848..0000000000000
--- a/llvm/test/tools/llvm-debuginfod-find/Inputs/buildid/abcdef/debuginfo
+++ /dev/null
@@ -1 +0,0 @@
-fake_debuginfo

diff  --git a/llvm/test/tools/llvm-debuginfod-find/Inputs/buildid/abcdef/executable b/llvm/test/tools/llvm-debuginfod-find/Inputs/buildid/abcdef/executable
deleted file mode 100644
index 629a578f0d69d..0000000000000
--- a/llvm/test/tools/llvm-debuginfod-find/Inputs/buildid/abcdef/executable
+++ /dev/null
@@ -1 +0,0 @@
-fake_executable

diff  --git a/llvm/test/tools/llvm-debuginfod-find/Inputs/buildid/abcdef/source/directory/file.c b/llvm/test/tools/llvm-debuginfod-find/Inputs/buildid/abcdef/source/directory/file.c
deleted file mode 100644
index 2bc87d0c3c0d2..0000000000000
--- a/llvm/test/tools/llvm-debuginfod-find/Inputs/buildid/abcdef/source/directory/file.c
+++ /dev/null
@@ -1 +0,0 @@
-int foo = 0;

diff  --git a/llvm/test/tools/llvm-debuginfod-find/debuginfod.test b/llvm/test/tools/llvm-debuginfod-find/debuginfod.test
deleted file mode 100644
index 798f6f3c8ee6e..0000000000000
--- a/llvm/test/tools/llvm-debuginfod-find/debuginfod.test
+++ /dev/null
@@ -1,77 +0,0 @@
-# REQUIRES: curl
-# RUN: rm -rf %t
-# RUN: mkdir %t
-# # Query the python server for artifacts
-# RUN: env DEBUGINFOD_CACHE_PATH=%t %python %s --server-path %S/Inputs \
-# RUN:   --tool-cmd 'llvm-debuginfod-find --dump --executable abcdef' | \
-# RUN:   FileCheck %s --check-prefix=EXECUTABLE
-# RUN: env DEBUGINFOD_CACHE_PATH=%t %python %s --server-path %S/Inputs \
-# RUN:   --tool-cmd 'llvm-debuginfod-find --dump --source=/directory/file.c abcdef' | \
-# RUN:   FileCheck %s --check-prefix=SOURCE
-# RUN: env DEBUGINFOD_CACHE_PATH=%t %python %s --server-path %S/Inputs \
-# RUN:   --tool-cmd 'llvm-debuginfod-find --dump --debuginfo abcdef' | \
-# RUN:   FileCheck %s --check-prefix=DEBUGINFO
-
-# EXECUTABLE: fake_executable
-# SOURCE: int foo = 0;
-# DEBUGINFO: fake_debuginfo
-
-# # The artifacts should still be present in the cache without needing to query
-# # the server.
-# RUN: env DEBUGINFOD_CACHE_PATH=%t llvm-debuginfod-find --dump --executable abcdef | \
-# RUN:   FileCheck %s --check-prefix=EXECUTABLE
-# RUN: env DEBUGINFOD_CACHE_PATH=%t llvm-debuginfod-find --dump \
-# RUN:   --source=/directory/file.c abcdef | \
-# RUN:   FileCheck %s --check-prefix=SOURCE
-# RUN: env DEBUGINFOD_CACHE_PATH=%t llvm-debuginfod-find --dump --debuginfo abcdef | \
-# RUN:   FileCheck %s --check-prefix=DEBUGINFO
-
-
-# This script is used to test the debuginfod client within a host tool.
-# It first stands up a Python HTTP static file server and then executes the tool.
-# This way the tool can make debuginfod HTTP requests to the static file server.
-import argparse
-import threading
-import http.server
-import functools
-import subprocess
-import sys
-import os
-
-
-# Serves files at the server_path, then runs the tool with specified args.
-# Sets the DEBUGINFOD_CACHE_PATH env var to point at the given cache_directory.
-# Sets the DEBUGINFOD_URLS env var to point at the local server.
-def test_tool(server_path, tool_args):
-    httpd = http.server.ThreadingHTTPServer(
-        ('',0), functools.partial(
-            http.server.SimpleHTTPRequestHandler,
-            directory=server_path))
-    port = httpd.server_port
-    thread = threading.Thread(target=httpd.serve_forever)
-    try:
-        thread.start()
-        env = os.environ
-        env['DEBUGINFOD_URLS'] = 'http://localhost:%s' % port
-        process = subprocess.Popen(
-            tool_args, env=env)
-        code = process.wait()
-        if code != 0:
-            print('nontrivial return code %s' % code)
-            return 1
-    finally:
-        httpd.shutdown()
-        thread.join()
-    return 0
-
-def main():
-    parser = argparse.ArgumentParser()
-    parser.add_argument('--server-path', default='./')
-    parser.add_argument('--tool-cmd', required=True, type=str)
-    args = parser.parse_args()
-    result = test_tool(args.server_path,
-        args.tool_cmd.split())
-    sys.exit(result)
-
-if __name__ == '__main__':
-    main()


        


More information about the llvm-commits mailing list