Skip to content

Commit

Permalink
Created an SQL file containing assertions that should be generated fo…
Browse files Browse the repository at this point in the history
…r Demo1. Workflow::generateAssertions() now inserts those into the database, effectively mocking raire-service for the purpose of testing.
  • Loading branch information
michelleblom committed Nov 22, 2024
1 parent c5d20ca commit 75a6f72
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
import io.restassured.path.json.JsonPath;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.ext.ScriptUtils;
import org.testcontainers.jdbc.JdbcDatabaseDelegate;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import us.freeandfair.corla.persistence.Persistence;
Expand All @@ -42,7 +40,7 @@
/**
* A demonstration workflow that uploads CVRs and ballot manifests for all 64 counties.
* At the moment, this seems to run fine if run alone, but not to run in parallel with
* EstimateSamplesVaryingManifests, or in * github actions. Hence currently disabled.
* EstimateSamplesVaryingManifests.
*/
@Test(enabled=true)
public class Demo1 extends Workflow {
Expand Down Expand Up @@ -138,11 +136,11 @@ public void runDemo1() throws InterruptedException {
assertEquals(dashboard.get(ASM_STATE), PARTIAL_AUDIT_INFO_SET.toString());

// 4. Generate assertions; sanity check
// TODO this is commented out for now while we figure out how to run the raire-service in the Docker container.
// generateAssertions(1);
// dashboard = getDoSDashBoardRefreshResponse();
generateAssertions("SQL/demo1-assertions.sql", 1);
dashboard = getDoSDashBoardRefreshResponse();

// There should be 4 IRV contests.
// assertEquals(4, dashboard.getList("generate_assertions_summaries").size());
assertEquals(4, dashboard.getList("generate_assertions_summaries").size());

// 5. Choose targeted contests for audit.
targetContests(Map.of("City of Longmont - Mayor","COUNTY_WIDE_CONTEST",
Expand All @@ -161,7 +159,7 @@ public void runDemo1() throws InterruptedException {
Map<String, EstimateSampleSizes.EstimateData> sampleSizes = getSampleSizeEstimates();
assertFalse(sampleSizes.isEmpty());

// TODO get assertions, sanity check, but first get the raire-service working (see above).
// TODO Sanity check of assertions and sample size estimates.

LOGGER.debug("Successfully completed Demo1.");
}
Expand Down
Loading

0 comments on commit 75a6f72

Please sign in to comment.