Skip to content

Commit

Permalink
Use End-of-flags to pass extra arguments to runners (#17)
Browse files Browse the repository at this point in the history
* Use End-of-flags to pass extra arguments to runners

* Bump version
  • Loading branch information
abdala authored Oct 24, 2024
1 parent df79fbb commit 457e8e6
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 106 deletions.
2 changes: 1 addition & 1 deletion assert/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cgauge/assert",
"version": "0.6.0",
"version": "0.7.0",
"description": "Extra assert library",
"type": "module",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions dtc-aws-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cgauge/dtc-aws-plugin",
"version": "0.6.0",
"version": "0.7.0",
"description": "AWS plugin for Declarative TestCases",
"repository": {
"type": "git",
Expand All @@ -15,9 +15,9 @@
"author": "Abdala Cerqueira",
"license": "LGPL-3.0-or-later",
"dependencies": {
"@cgauge/assert": "^0.6.0",
"@cgauge/dtc": "^0.6.0",
"@cgauge/nock-aws": "^0.6.0",
"@cgauge/assert": "^0.7.0",
"@cgauge/dtc": "^0.7.0",
"@cgauge/nock-aws": "^0.7.0",
"@aws-sdk/client-dynamodb": "^3.645.0",
"@aws-sdk/client-eventbridge": "^3.645.0",
"@aws-sdk/client-lambda": "^3.645.0",
Expand Down
6 changes: 3 additions & 3 deletions dtc-mysql-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cgauge/dtc-mysql-plugin",
"version": "0.6.0",
"version": "0.7.0",
"description": "MySQL plugin for Declarative TestCases",
"repository": {
"type": "git",
Expand All @@ -15,8 +15,8 @@
"author": "Abdala Cerqueira",
"license": "LGPL-3.0-or-later",
"dependencies": {
"@cgauge/assert": "^0.6.0",
"@cgauge/dtc": "^0.6.0",
"@cgauge/assert": "^0.7.0",
"@cgauge/dtc": "^0.7.0",
"mysql2": "^3.11.0",
"node-sql-parser": "^5.1.0"
},
Expand Down
6 changes: 3 additions & 3 deletions dtc-playwright-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cgauge/dtc-playwright-plugin",
"version": "0.6.0",
"version": "0.7.0",
"description": "Playwright plugin for Declarative TestCases",
"repository": {
"type": "git",
Expand All @@ -15,8 +15,8 @@
"author": "Abdala Cerqueira",
"license": "LGPL-3.0-or-later",
"dependencies": {
"@cgauge/assert": "^0.6.0",
"@cgauge/dtc": "^0.6.0",
"@cgauge/assert": "^0.7.0",
"@cgauge/dtc": "^0.7.0",
"@playwright/test": "^1.47.0"
},
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions dtc-playwright-plugin/src/playwright-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import * as url from 'url'

const __dirname = url.fileURLToPath(new URL('.', import.meta.url))

export default (args?: string[]) =>
async (testCaseExecutions: TestCaseExecution[], _plugins: string[], config?: string) => {
export default (constructorArgs?: string[]) =>
async (testCaseExecutions: TestCaseExecution[], _plugins: string[], runnerArgs: string[], config?: string) => {
const args = [...runnerArgs, ...constructorArgs ?? []]
const childProcess = spawnSync(`npx playwright test ${args?.join(' ')} ${__dirname}`, {
stdio: 'inherit',
shell: true,
Expand Down
1 change: 1 addition & 0 deletions dtc-playwright-plugin/test/playwright-runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ test('It calls playwright runner', async () => {
{filePath: `${__dirname}/fixtures/t2.dtc.js`, testCase: testCase2},
],
[],
[],
`./test/fixtures/config.js`,
)

Expand Down
4 changes: 2 additions & 2 deletions dtc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cgauge/dtc",
"version": "0.6.0",
"version": "0.7.0",
"description": "Declarative TestCases",
"repository": {
"type": "git",
Expand All @@ -18,7 +18,7 @@
"author": "Abdala Cerqueira",
"license": "LGPL-3.0-or-later",
"dependencies": {
"@cgauge/assert": "^0.6.0",
"@cgauge/assert": "^0.7.0",
"cleye": "^1.3.2",
"nock": "^14.0.0-beta.11"
},
Expand Down
2 changes: 1 addition & 1 deletion dtc/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ if (!runner) {
throw new Error(`No test runner found`)
}

await runner(testCaseExecutions, plugins, config)
await runner(testCaseExecutions, plugins, argv._['--'], config)
2 changes: 1 addition & 1 deletion dtc/src/domain.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type Loader = (filePath: string) => Promise<TestCase>

export type Runner = (testCases: TestCaseExecution[], plugins: string[], config?: string) => Promise<void>
export type Runner = (testCases: TestCaseExecution[], plugins: string[], args?: string[], config?: string) => Promise<void>

export type GenericAttributes = {
[key: string]: string | number | boolean | Record<string, unknown> | Record<string, unknown>[]
Expand Down
2 changes: 1 addition & 1 deletion nock-aws/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cgauge/nock-aws",
"version": "0.6.0",
"version": "0.7.0",
"description": "AWS Request mocker based on Nock",
"repository": {
"type": "git",
Expand Down
105 changes: 18 additions & 87 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion yaml/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cgauge/yaml",
"version": "0.6.0",
"version": "0.7.0",
"description": "YAML parser with extra tags",
"repository": {
"type": "git",
Expand Down

0 comments on commit 457e8e6

Please sign in to comment.