Skip to content

Commit

Permalink
Issue #6334 - Add JSONSchema definitions for configuration YAML files
Browse files Browse the repository at this point in the history
  • Loading branch information
Sweetchuck committed Jan 29, 2022
1 parent 8a18c74 commit 95affb3
Show file tree
Hide file tree
Showing 2 changed files with 189 additions and 0 deletions.
154 changes: 154 additions & 0 deletions schema/codeception.schema.yml
@@ -0,0 +1,154 @@
$id: 'https://codeception.com/1/codeception.schema.yml'
$schema: 'https://json-schema.org/draft/2020-12/schema'
title: 'codeception.dist.yml'
description: 'Schema definition for Codeception main configuration YAML file.'

definitions:
paths:
type: object
additionalProperties:
type: string
properties:
test:
type: string
log:
type: string
data:
type: string
support:
type: string

settings:
type: object
additionalProperties: true
properties:
shuffle:
type: boolean
suite_class:
type: string
colors:
type: boolean
memory_limit:
type: string
log:
type: boolean
lint:
type: boolean
report_useless_tests:
type: boolean
disallow_test_output:
type: boolean
be_strict_about_changes_to_global_state:
type: boolean
log_incomplete_skipped:
type: boolean

modules:
type: object
additionalProperties: true
properties:
config:
type: object
additionalProperties: true

extensions:
type: object
additionalProperties: true
properties:
enabled:
type: array
items:
type: string
config:
type: object
additionalProperties: true
commands:
type: object
additionalProperties: true

step_decorators:
type: array
items:
type: string

reporters:
type: object
description: |
https://codeception.com/docs/08-Customization#custom-reporters
additionalProperties:
type: string
examples:
-
xml: Codeception\PHPUnit\Log\JUnit
html: Codeception\PHPUnit\ResultPrinter\HTML
report: Codeception\PHPUnit\ResultPrinter\Report
coverage:
type: object
additionalProperties: true
properties:
enabled:
type: boolean
show_uncovered:
type: boolean
low_limit:
type: integer
minimum: 0
maximum: 100
high_limit:
type: integer
minimum: 0
maximum: 100
include:
'$ref': '#/definitions/pathPatternList'
whitelist:
type: object
additionalProperties: true
properties:
include:
'$ref': '#/definitions/pathPatternList'

pathPatternList:
type: array
items:
type: string

suite:
type: object
additionalProperties: true
properties:
path:
type: string

suites:
type: object
additionalProperties:
'$ref': '#/definitions/suite'

type: object
properties:
namespace:
type: string
description: |
https://codeception.com/docs/08-Customization#namespaces
bootstrap:
type: string
description: |
https://codeception.com/docs/08-Customization#bootstrap
actor:
type: string
paths:
'$ref': '#/definitions/paths'
settings:
'$ref': '#/definitions/settings'
modules:
'$ref': '#/definitions/modules'
extensions:
'$ref': '#/definitions/extensions'
step_decorators:
'$ref': '#/definitions/step_decorators'
reporters:
'$ref': '#/definitions/reporters'
coverage:
'$ref': '#/definitions/coverage'
suites:
'$ref': '#/definitions/suites'
35 changes: 35 additions & 0 deletions schema/suite.schema.yml
@@ -0,0 +1,35 @@
$id: 'https://codeception.com/1/suite.schema.yml'
$schema: 'https://json-schema.org/draft/2020-12/schema'
title: 'suite.dist.yml'
description: 'Schema definition for Codeception suite configuration YAML files.'

type: object
additionalProperties: true
properties:
bootstrap:
type: string
error_level:
type: string
class_name:
type: string
actor:
type: string
modules:
type: object
additionalProperties: true
properties:
enabled:
type: array
items:
oneOf:
-
type: string
-
type: object
additionalProperties: true
maxProperties: 1
minProperties: 1
steps:
type: array
items:
type: string

0 comments on commit 95affb3

Please sign in to comment.