-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #419 from Informatievlaanderen/feat/ldes-discovere…
…r-e2e Feat/ldes discoverer e2e
- Loading branch information
Showing
22 changed files
with
33,025 additions
and
19 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 |
---|---|---|
@@ -1 +1 @@ | ||
* @Yalz @rorlic @WLefever-Cegeka @pj-cegeka @Tomvbe | ||
* @Yalz @rorlic @pj-cegeka @Tomvbe @jobulcke |
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
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,10 @@ | ||
@discoverer | ||
Feature: LDI LDES Discoverer | ||
|
||
@test-038 @discover @geomobility | ||
Scenario: 038: LDES Discoverer Can Discover The Structure of an LDES | ||
Given context 'tests/038.discover-ldes-structure' is started | ||
And I have aliased the 'geomobility' simulator data set | ||
When I start the LDES Discoverer | ||
Then the LDES structure contains 10 relations | ||
And the LDES structure is equal to "expected-output.txt" |
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,76 @@ | ||
/// <reference types="cypress" /> | ||
|
||
import {CanCheckAvailability} from "./interfaces"; | ||
import {timeouts} from "../common"; | ||
|
||
export class LdiLdesDiscoverer implements CanCheckAvailability { | ||
constructor(private _serviceName?: string) { | ||
} | ||
|
||
public get serviceName() { | ||
return this._serviceName || 'ldes-discoverer'; | ||
} | ||
|
||
protected get availabilityMessage() { | ||
return "Started Application in"; | ||
} | ||
|
||
private containerLogIncludes(containerId: string, includeString: string) { | ||
return cy.exec(`docker logs ${containerId}`).then(result => result.stdout.includes(includeString)); | ||
} | ||
|
||
waitForDockerLog(includeString: string) { | ||
return cy.exec(`docker ps -f "name=${this.serviceName}$" -q`) | ||
.then(result => { | ||
const containerId = result.stdout; | ||
return cy.waitUntil(() => this.containerLogIncludes(containerId, includeString), { | ||
timeout: timeouts.slowAction, | ||
interval: timeouts.slowCheck, | ||
errorMsg: `Timed out waiting for container '${this.serviceName}' log to include '${includeString}'` | ||
}); | ||
}); | ||
} | ||
|
||
waitAvailable() { | ||
this.waitForDockerLog(this.availabilityMessage); | ||
} | ||
|
||
getContainerId() { | ||
return cy.exec(`docker ps -qaf "name=${this.serviceName}$" -q`) | ||
.then(result => result.stdout) | ||
} | ||
|
||
extractLogs(containerId: string) { | ||
return cy.exec(`docker logs ${containerId}`).then(result => result.stdout) | ||
} | ||
|
||
hasCount(containerId: string, count: number): any { | ||
return this.extractLogs(containerId).then(logs => { | ||
const totalOfStr = "contains a total of "; | ||
const startIndex = logs.indexOf(totalOfStr) + totalOfStr.length; | ||
const endIndex = logs.indexOf(" relations:"); | ||
const actualCount = Number.parseInt(logs.substring(startIndex, endIndex).trim()); | ||
cy.log(`Actual count: ${actualCount}`).then(() => actualCount === count) | ||
}); | ||
} | ||
|
||
checkRelationCount(count: number) { | ||
return this.getContainerId() | ||
.then(containerId => { | ||
return cy.waitUntil(() => this.hasCount(containerId, count), { | ||
timeout: timeouts.ready, | ||
interval: timeouts.check, | ||
errorMsg: `Timed out waiting for relation count to be ${count}` | ||
}) | ||
}) | ||
} | ||
|
||
checkOutputStructure(expectedOutputFilePath: string) { | ||
return cy.exec(`cat ${expectedOutputFilePath}`) | ||
.then(result => { | ||
this.getContainerId().then(containerId => { | ||
this.containerLogIncludes(containerId, result.stdout) | ||
}) | ||
}) | ||
} | ||
} |
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
Oops, something went wrong.