Files
swift-mirror/test/CAS/Inputs/ExtractOutputKey.py
Steven Wu 52671e1a6a [Caching] Improve swift caching related tests
Improve caching related tests to make them faster and test the situation
closer to what actually happens during explicit module build. Most
noticable changes are:
* Avoid swift stdlib dependency during the tests to save time
* Use dependency scanner output to construct test cases
* Update old test cases that try to simulate caching from file system
  inputs to using only CAS inputs.
2024-01-28 22:06:59 -08:00

18 lines
338 B
Python
Executable File

#!/usr/bin/env python3
#
# Usage: ExtractOutputKey.py file.json InputPath
import json
import sys
input_json = sys.argv[1]
input_path = sys.argv[2]
with open(input_json, 'r') as file:
entries = json.load(file)
for entry in entries:
if entry['Input'] != input_path:
continue
print(entry['CacheKey'])