-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: take integration tests into account for front coverage
- Loading branch information
Showing
29 changed files
with
985 additions
and
256 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
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
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 |
---|---|---|
@@ -1,45 +1,54 @@ | ||
variable "OSRD_GIT_DESCRIBE" {} | ||
|
||
variable "TAG_PATTERNS" { | ||
variable "TAG_VERSION" { | ||
default = "dev" | ||
} | ||
|
||
variable "TAG_PREFIX" { | ||
default = "ghcr.io/osrd-project/edge/" | ||
} | ||
|
||
function "tags" { | ||
params = [image_name] | ||
result = [for pat in split(",", TAG_PATTERNS): format(pat, image_name)] | ||
params = [image_name, suffix] | ||
result = [format("%sosrd-%s:%s%s", TAG_PREFIX, image_name, TAG_VERSION, suffix)] | ||
} | ||
|
||
target "base-core" { | ||
tags = tags("core") | ||
tags = tags("core", "") | ||
} | ||
|
||
target "base-core-build" { | ||
tags = tags("core-build") | ||
tags = tags("core", "-build") | ||
} | ||
|
||
target "base-editoast" { | ||
tags = tags("editoast") | ||
tags = tags("editoast", "") | ||
} | ||
|
||
target "base-editoast-test" { | ||
tags = tags("editoast", "-test") | ||
} | ||
|
||
target "base-front-dev" { | ||
tags = tags("front-dev") | ||
target "base-front-devel" { | ||
tags = tags("front", "-devel") | ||
} | ||
|
||
target "base-front-nginx" { | ||
tags = tags("front-nginx") | ||
target "base-front-test" { | ||
tags = tags("front", "-test") | ||
} | ||
|
||
target "base-front-build" { | ||
tags = tags("front-build") | ||
tags = tags("front", "-build") | ||
} | ||
|
||
target "base-gateway-standalone" { | ||
tags = tags("gateway-standalone") | ||
tags = tags("gateway", "-standalone") | ||
} | ||
|
||
target "base-gateway-test" { | ||
tags = tags("gateway-test") | ||
tags = tags("gateway", "-test") | ||
} | ||
|
||
target "base-gateway-front" { | ||
tags = tags("gateway-front") | ||
tags = tags("gateway", "-front") | ||
} |
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
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
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
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
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
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
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,34 @@ | ||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
import * as crypto from 'crypto'; | ||
import { test as baseTest } from '@playwright/test'; | ||
export { request } from '@playwright/test'; | ||
import type { Page, Locator } from '@playwright/test'; | ||
export type { Page, Locator }; | ||
|
||
const istanbulCLIOutput = path.join(process.cwd(), '.nyc_output'); | ||
|
||
export function generateUUID(): string { | ||
return crypto.randomBytes(16).toString('hex'); | ||
} | ||
|
||
export const test = baseTest.extend({ | ||
context: async ({ context }, use) => { | ||
await context.addInitScript(() => | ||
window.addEventListener('beforeunload', () => | ||
(window as any).collectIstanbulCoverage(JSON.stringify((window as any).__coverage__)) | ||
), | ||
); | ||
await fs.promises.mkdir(istanbulCLIOutput, { recursive: true }); | ||
await context.exposeFunction('collectIstanbulCoverage', (coverageJSON: string) => { | ||
if (coverageJSON) | ||
fs.writeFileSync(path.join(istanbulCLIOutput, `playwright_coverage_${generateUUID()}.json`), coverageJSON); | ||
}); | ||
await use(context); | ||
for (const page of context.pages()) { | ||
await page.evaluate(() => (window as any).collectIstanbulCoverage(JSON.stringify((window as any).__coverage__))) | ||
} | ||
} | ||
}); | ||
|
||
export const expect = test.expect; |
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
Oops, something went wrong.