Skip to content

Commit

Permalink
Oracle and SQL Server test adjustments
Browse files Browse the repository at this point in the history
* Split app DeploymentCollectionResourceTest to test sorting and querying separately
* Make sure that surefire reports are uploaded with unique names
  • Loading branch information
filiphr committed Aug 1, 2024
1 parent f70f947 commit 936433b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ failure() && steps.test.conclusion == 'failure' }}
with:
name: surefire-test-reports
name: surefire-test-reports-${{ matrix.oracle }}
path: '**/target/surefire-reports/*'
2 changes: 1 addition & 1 deletion .github/workflows/sql-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ failure() && steps.test.conclusion == 'failure' }}
with:
name: surefire-test-reports
name: surefire-test-reports-${{ matrix.mssql }}
path: '**/target/surefire-reports/*'
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,33 @@ public void testGetDeployments() throws Exception {
// Check without tenantId filtering
url = baseUrl + "?withoutTenantId=true";
assertResultsPresentInDataResponse(url, firstDeployment.getId());
} finally {
// Always cleanup any created deployments, even if the test failed
List<AppDeployment> deployments = repositoryService.createDeploymentQuery().list();
for (AppDeployment deployment : deployments) {
repositoryService.deleteDeployment(deployment.getId(), true);
}
}
}

public void testGetDeploymentsSorting() throws Exception {

try {
// Alter time to ensure different deployTimes
Calendar yesterday = Calendar.getInstance();
yesterday.add(Calendar.DAY_OF_MONTH, -1);
appEngineConfiguration.getClock().setCurrentTime(yesterday.getTime());

AppDeployment firstDeployment = repositoryService.createDeployment().name("Deployment 1").category("DEF")
.addClasspathResource("org/flowable/app/rest/service/api/repository/oneApp.app")
.tenantId("acme")
.deploy();

appEngineConfiguration.getClock().setCurrentTime(Calendar.getInstance().getTime());
AppDeployment secondDeployment = repositoryService.createDeployment().name("Deployment 2").category("ABC")
.addClasspathResource("org/flowable/app/rest/service/api/repository/oneApp.app")
.tenantId("myTenant")
.deploy();

// Check ordering by name
CloseableHttpResponse response = executeRequest(
Expand Down

0 comments on commit 936433b

Please sign in to comment.