Skip to content

Commit d5fae63

Browse files
committed
Improve the missing testcases archive error message
1 parent 9967fe5 commit d5fae63

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Diff for: core/src/test/java/com/styra/opa/wasm/OpaCli.java

+11-2
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,19 @@ public static void prepareTestcases() {
9696
testcasesDestFolder.resolve(testcasesTar),
9797
StandardCopyOption.REPLACE_EXISTING);
9898
} catch (IOException e) {
99+
var path = testcasesTarPath.toFile().getAbsolutePath();
100+
var additionalInstructions = "";
101+
if (path.endsWith("testcases.tar.gz")) {
102+
additionalInstructions =
103+
", to obtain the archive you need to clone"
104+
+ " 'github.com/open-policy-agent/opa' and run the command:"
105+
+ " `WASM_BUILD_ONLY=true make wasm-rego-test`, you should be able to"
106+
+ " find the result in the Go cache directory";
107+
}
99108
throw new RuntimeException(
100109
testcasesTarPath.toFile().getAbsolutePath()
101-
+ " file not found in root, please download it ... let figure out"
102-
+ " how!",
110+
+ " file not found in root"
111+
+ additionalInstructions,
103112
e);
104113
}
105114
List<String> tarCommand = new ArrayList<>();

0 commit comments

Comments
 (0)