Skip to content

Commit

Permalink
test: remove snyk from integration tests (#97)
Browse files Browse the repository at this point in the history
Fixes: https://issues.redhat.com/browse/APPENG-2367.


## Checklist

- [x] I have followed this repository's contributing guidelines.
- [x] I will adhere to the project's code of conduct.

Signed-off-by: Zvi Grinberg <zgrinber@redhat.com>
  • Loading branch information
zvigrinberg authored Mar 25, 2024
1 parent c399171 commit c344cfb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/test/java/com/redhat/exhort/impl/ExhortApiIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void Integration_Test_End_To_End_Stack_Analysis_Html(Ecosystem.Type packageManag
String manifestFileName = ecoSystemsManifestNames.get(packageManager.getType());
String pathToManifest = getFileFromResource(manifestFileName, "tst_manifests", "it", packageManager.getType(), manifestFileName);
preparePythonEnvironment(packageManager);
// Github action runner with all maven and java versions seems to enter infinite loop in integration tests of MAVEN when runnig dependency maven plugin to produce verbose text dependenct tree format.
// Github action runner with all maven and java versions seems to enter infinite loop in integration tests of MAVEN when running dependency maven plugin to produce verbose text dependenct tree format.
// locally it's not recreated with same versions
mockMavenDependencyTree(packageManager);
String analysisReportHtml = new String(api.stackAnalysisHtml(pathToManifest).get());
Expand Down Expand Up @@ -179,12 +179,15 @@ private void handleHtmlResponse(String analysisReportHtml) throws JsonProcessing
assertTrue(analysisReportHtml.contains("svg") && analysisReportHtml.contains("html"));
int jsonStart = analysisReportHtml.indexOf("\"report\":");
int jsonEnd = analysisReportHtml.indexOf("}}}}}");
if(jsonEnd == -1) {
jsonEnd = analysisReportHtml.indexOf("}}}}");
}
String embeddedJson = analysisReportHtml.substring(jsonStart + 9 ,jsonEnd + 5);
JsonNode jsonInHtml = om.readTree(embeddedJson);
JsonNode scannedNode = jsonInHtml.get("scanned");
assertTrue(scannedNode.get("total").asInt(0) > 0);
assertTrue(scannedNode.get("transitive").asInt(0) > 0);
JsonNode status = jsonInHtml.get("providers").get("snyk").get("status");
JsonNode status = jsonInHtml.get("providers").get("osv-nvd").get("status");
assertTrue(status.get("code").asInt(0) == 200);
assertTrue(status.get("ok").asBoolean(false));

Expand Down

0 comments on commit c344cfb

Please sign in to comment.