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 08c8456
Show file tree
Hide file tree
Showing 2 changed files with 377 additions and 0 deletions.
231 changes: 231 additions & 0 deletions schema/codeception.schema.yml
@@ -0,0 +1,231 @@
$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:
actor_suffix:
type: string
default: 'Tester'

namespace:
type: string
default: ''

include:
type: array
default: []

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

extends:
# @todo
oneOf:
-
type: 'null'
-
type: string

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

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

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

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
tap: PHPUnit\Util\Log\TAP
json: PHPUnit\Util\Log\JSON
phpunit-xml: Codeception\PHPUnit\Log\PhpUnit

groups:
# @todo
type: array
default: []

bootstrap:
oneOf:
-
type: 'null'
-
type: 'string'

settings:
type: object
additionalProperties: true
properties:
colors:
type: boolean
default: true
bootstrap:
deprecationMessage: 'Use #/bootstrap instead.'
oneOf:
-
type: 'null'
-
type: 'string'
strict_xml:
type: boolean
default: false
lint:
type: boolean
default: true
backup_globals:
type: boolean
default: true
log_incomplete_skipped:
type: boolean
default: false
report_useless_tests:
type: boolean
default: false
disallow_test_output:
type: boolean
default: false
be_strict_about_changes_to_global_state:
type: boolean
default: false
shuffle:
type: boolean
default: false
suite_class:
type: string
memory_limit:
type: string
log:
type: boolean

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/path_pattern_list'
whitelist:
type: object
additionalProperties: true
properties:
include:
'$ref': '#/definitions/path_pattern_list'

params:
# @todo
type: object
additionalProperties: true

gherkin:
# @todo
type: object
additionalProperties: true

actor:
type: string

step_decorators:
type: array
items:
type: string

path_pattern_list:
type: array
items:
type: string

type: object
properties:
actor_suffix:
'$ref': '#/definitions/actor_suffix'
namespace:
'$ref': '#/definitions/namespace'
include:
'$ref': '#/definitions/include'
paths:
'$ref': '#/definitions/paths'
extends:
'$ref': '#/definitions/extends'
suites:
'$ref': '#/definitions/suites'
modules:
'$ref': '#/definitions/modules'
extensions:
'$ref': '#/definitions/extensions'
reporters:
'$ref': '#/definitions/reporters'
groups:
'$ref': '#/definitions/groups'
bootstrap:
'$ref': '#/definitions/bootstrap'
settings:
'$ref': '#/definitions/settings'
coverage:
'$ref': '#/definitions/coverage'
params:
'$ref': '#/definitions/params'
gherkin:
'$ref': '#/definitions/gherkin'
actor:
'$ref': '#/definitions/actor'
step_decorators:
'$ref': '#/definitions/step_decorators'
146 changes: 146 additions & 0 deletions schema/suite.schema.yml
@@ -0,0 +1,146 @@
$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:
actor:
oneOf:
-
type: 'null'
-
type: string

modules:
type: object
additionalProperties: true
properties:
enabled:
type: array
items:
oneOf:
-
type: string
-
type: object
additionalProperties: true
maxProperties: 1
minProperties: 1
config:
type: object
additionalProperties: true
depends:
# @todo
type: array
items:
type: string

step_decorators:
# @todo
type: array
items:
type: string

path:
# @todo
oneOf:
-
type: 'null'
-
type: string

extends:
# @todo
oneOf:
-
type: 'null'
-
type: string

namespace:
oneOf:
-
type: 'null'
-
type: 'string'

groups:
# @todo
type: array
default: [ ]

formats:
# @todo
type: array
default: [ ]

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

error_level:
type: string
default: 'E_ALL & ~E_STRICT & ~E_DEPRECATED'

colors:
type: boolean
default: true

strict_xml:
type: boolean
default: false

lint:
type: boolean
default: true

backup_globals:
type: boolean
default: true

log_incomplete_skipped:
type: boolean
default: false

report_useless_tests:
type: boolean
default: false

disallow_test_output:
type: boolean
default: false

be_strict_about_changes_to_global_state:
type: boolean
default: false

shuffle:
type: boolean
default: false

suite_class:
type: string

memory_limit:
type: string

log:
type: boolean

class_name:
type: string

steps:
type: array
items:
type: string

0 comments on commit 08c8456

Please sign in to comment.