-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP external events scheduling e2e tests
- Loading branch information
1 parent
f8197c9
commit 4314ada
Showing
2 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...tests/src/test/java/gov/nasa/jpl/aerie/e2e/procedural/scheduling/ExternalEventsTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package gov.nasa.jpl.aerie.e2e.procedural.scheduling; | ||
|
||
import gov.nasa.jpl.aerie.e2e.ExternalDatasetsTest; | ||
import gov.nasa.jpl.aerie.e2e.types.GoalInvocationId; | ||
import gov.nasa.jpl.aerie.e2e.utils.GatewayRequests; | ||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
public class ExternalEventsTests extends ProceduralSchedulingSetup { | ||
private GoalInvocationId procedureId; | ||
private int datasetId; | ||
|
||
@BeforeEach | ||
void localBeforeEach() throws IOException { | ||
try (final var gateway = new GatewayRequests(playwright)) { | ||
int procedureJarId = gateway.uploadJarFile("build/libs/ExternalEventsGoal.jar"); | ||
// Add Scheduling Procedure | ||
procedureId = hasura.createSchedulingSpecProcedure( | ||
"Test Scheduling Procedure", | ||
procedureJarId, | ||
specId, | ||
0 | ||
); | ||
|
||
datasetId = hasura.insertExternalDataset( | ||
planId, | ||
"2023-001T01:00:00.000", | ||
List.of(ExternalDatasetsTest.myBooleanProfile) | ||
); | ||
} | ||
|
||
// TODO pranav add a method to the HasuraRequests class for uploading events | ||
// TODO pranav upload some events | ||
} | ||
|
||
@AfterEach | ||
void localAfterEach() throws IOException { | ||
hasura.deleteSchedulingGoal(procedureId.goalId()); | ||
hasura.deleteExternalDataset(planId, datasetId); | ||
|
||
// TODO pranav add a method to HasuraRequests for deleting events | ||
// TODO pranav delete the events added in localBeforeEach | ||
} | ||
|
||
@Test | ||
void testExternalEventQuery() throws IOException { | ||
hasura.awaitScheduling(specId); | ||
|
||
final var plan = hasura.getPlan(planId); | ||
final var activities = plan.activityDirectives(); | ||
|
||
// TODO pranav make sure the ExternalEventsGoal successfully made Bite Banana activities | ||
// one-to-one with the uploaded events. | ||
} | ||
} |