commented out data verification for cql workloads because it is too specific, workloads that did not create this data did not work for this test

This commit is contained in:
MikeYaacoubStax 2023-02-21 17:37:16 -05:00
parent 54e5428f8f
commit 0afcb24521

View File

@ -127,51 +127,53 @@ public class WorkloadContainerVerifications {
logger.info("NB5 command completed with no errors"); logger.info("NB5 command completed with no errors");
//STEP 4 Check the cluster for created data //STEP 3 Check the cluster for created data
try (CqlSession session = CqlSession.builder().addContactPoint(new InetSocketAddress(hostIP, mappedPort9042)).withLocalDatacenter(datacenter).build()) { //THIS PART IS LEFT COMMENTED FOR RUNNING SPECIFIC CQL DATA CREATION CHECKING
//->Check for the creation of the keyspace baselines
logger.info("Checking for the creation of the keyspace \"baselines\"...");
ResultSet result = session.execute("SELECT keyspace_name FROM system_schema.keyspaces");
List<Row> rows = result.all();
boolean keyspaceFound = false;
for (Row row : rows) {
if (row.getString("keyspace_name").equals("baselines")) {
keyspaceFound = true;
break;
}
}
assertTrue(keyspaceFound);
logger.info("Keyspace \"baselines\" was found, nb5 command had created it successfully");
//->Check for the creation of the baselines keyvalue table // try (CqlSession session = CqlSession.builder().addContactPoint(new InetSocketAddress(hostIP, mappedPort9042)).withLocalDatacenter(datacenter).build()) {
logger.info("Checking for the creation of the table \"baselines.keyvalue\"..."); // //->Check for the creation of the keyspace baselines
result = session.execute("SELECT table_name FROM system_schema.tables WHERE keyspace_name='baselines'"); // logger.info("Checking for the creation of the keyspace \"baselines\"...");
rows = result.all(); // ResultSet result = session.execute("SELECT keyspace_name FROM system_schema.keyspaces");
boolean tableFound = false; // List<Row> rows = result.all();
for (Row row : rows) { // boolean keyspaceFound = false;
if (row.getString("table_name").equals("keyvalue")) { // for (Row row : rows) {
tableFound = true; // if (row.getString("keyspace_name").equals("baselines")) {
break; // keyspaceFound = true;
} // break;
} // }
assertTrue(tableFound); // }
logger.info("Table \"baselines.keyvalue\" was found, nb5 command had created it successfully"); // assertTrue(keyspaceFound);
// logger.info("Keyspace \"baselines\" was found, nb5 command had created it successfully");
//->Check for the creation of the baselines keyvalue table //
ResultSet resultSet = session.execute("SELECT count(*) FROM baselines.keyvalue"); // //->Check for the creation of the baselines keyvalue table
Row row = resultSet.one(); // logger.info("Checking for the creation of the table \"baselines.keyvalue\"...");
long rowCount = row.getLong(0); // result = session.execute("SELECT table_name FROM system_schema.tables WHERE keyspace_name='baselines'");
logger.info("Number of rows in baselines.keyvalue: " + rowCount); // rows = result.all();
assertTrue(rowCount >= 5); // boolean tableFound = false;
logger.info("Table \"baselines.keyvalue\" has at least 5 rows of key-value pairs, nb5 command had created them successfully"); // for (Row row : rows) {
// if (row.getString("table_name").equals("keyvalue")) {
} catch (Exception e) // tableFound = true;
{ // break;
System.out.println(e.getMessage()); // }
fail(); // }
} finally { // assertTrue(tableFound);
// logger.info("Table \"baselines.keyvalue\" was found, nb5 command had created it successfully");
//
// //->Check for the creation of the baselines keyvalue table
// ResultSet resultSet = session.execute("SELECT count(*) FROM baselines.keyvalue");
// Row row = resultSet.one();
// long rowCount = row.getLong(0);
// logger.info("Number of rows in baselines.keyvalue: " + rowCount);
// assertTrue(rowCount >= 5);
// logger.info("Table \"baselines.keyvalue\" has at least 5 rows of key-value pairs, nb5 command had created them successfully");
//
// } catch (Exception e)
// {
// System.out.println(e.getMessage());
// fail();
// } finally {
cass.stop(); cass.stop();
} // }
} }
} }
@AfterEach @AfterEach