Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Section 3.3.1 admits the string forms `<nonnegativefloatstring>` for amounts[].min and
# `<positivefloatstring>` for .max under FEATURE_BUNDLE_1, so the min <= max check that
# base/job_templates/3.3.1--amount-min-greater-than-max.invalid.yaml pins for numeric literals
# has to run on the parsed values here.
#
# min is '010.0' and max is '5.0', the only defect.
#
# The template must be rejected. Lexically '010.0' sorts below '5.0', so a lexical comparison
# reads min as under max and accepts it.
specificationVersion: jobtemplate-2023-09
extensions:
- FEATURE_BUNDLE_1
name: TestJob
steps:
- name: Step1
hostRequirements:
amounts:
- name: amount.worker.vcpu
min: '010.0'
max: '5.0'
script:
actions:
onRun:
command: python
args:
- "-c"
- "print()"
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Section 2.4 declares allowedValues as `[ <float> | <floatstring>, ... ]`, so membership is
# decided on the parsed value, not on the string form.
#
# The list is ['1.5', '2.5', '04.5'] and the submitted value is the number 4.5, which equals
# '04.5' numerically and matches no element textually. Negative twin:
# 1.1--float-floatstring-allowedvalues-violation.invalid.test.yaml.
#
# The job must be created and print 4.5. An implementation comparing string forms finds no
# match and wrongly rejects it.
template:
specificationVersion: jobtemplate-2023-09
name: TestJob
parameterDefinitions:
- name: Scale
type: FLOAT
allowedValues: ['1.5', '2.5', '04.5']
steps:
- name: Step1
script:
actions:
onRun:
command: python
args:
- -c
- print(r'SCALE:{{Param.Scale}}:END')
parameters:
Scale: 4.5
expected:
output:
- 'SCALE:4.5:END'
forbidden:
- '{{Param.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Section 2.4 declares allowedValues as `[ <float> | <floatstring>, ... ]` and a value absent
# from the list is an error.
#
# The list is ['1.5', '2.5', '04.5'] and the submitted value is the number 3.5, absent under
# every reading. Positive twin: 1.1--float-floatstring-allowedvalues-member.test.yaml.
#
# Job creation must fail. An implementation that skips a string-form allowedValues list because
# it cannot parse the elements admits the job.
#
# .invalid.test.yaml, not .invalid.yaml: the template is valid on its own and the error only
# fires once the submitted value is bound.
template:
specificationVersion: jobtemplate-2023-09
name: TestJob
parameterDefinitions:
- name: Scale
type: FLOAT
allowedValues: ['1.5', '2.5', '04.5']
steps:
- name: Step1
script:
actions:
onRun:
command: python
args:
- -c
- print(r'SCALE:{{Param.Scale}}:END')
parameters:
Scale: 3.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Section 2.4 declares minValue and maxValue as `<float> | <floatstring>`, ungated in base
# 2023-09, and the section 2 preamble (L151) makes both constraints validation must enforce.
#
# The bounds are the strings '010.0' and '100.0' and the submitted value is the number 50.5.
# Negative twin: 1.1--float-floatstring-bounds-violation.invalid.test.yaml.
#
# The job must be created and print 50.5. A lexical comparison orders '50.5' above '100.0' and
# rejects the job instead, which is the failure this pins.
template:
specificationVersion: jobtemplate-2023-09
name: TestJob
parameterDefinitions:
- name: Scale
type: FLOAT
minValue: '010.0'
maxValue: '100.0'
steps:
- name: Step1
script:
actions:
onRun:
command: python
args:
- -c
- print(r'SCALE:{{Param.Scale}}:END')
parameters:
Scale: 50.5
expected:
output:
- 'SCALE:50.5:END'
forbidden:
- '{{Param.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Section 2.4 declares minValue as `<float> | <floatstring>`, so a string bound has to be
# parsed and compared numerically.
#
# The bounds are the strings '010.0' and '100.0' and the submitted value is the number 5.5,
# below the minimum. Positive twin: 1.1--float-floatstring-bounds-satisfied.test.yaml.
#
# Job creation must fail. Lexically '5.5' sorts above '010.0', so a lexical comparison admits
# the job, as does an implementation that cannot parse a string bound at all.
#
# .invalid.test.yaml, not .invalid.yaml: the template is valid on its own and the error only
# fires once the submitted value is bound.
template:
specificationVersion: jobtemplate-2023-09
name: TestJob
parameterDefinitions:
- name: Scale
type: FLOAT
minValue: '010.0'
maxValue: '100.0'
steps:
- name: Step1
script:
actions:
onRun:
command: python
args:
- -c
- print(r'SCALE:{{Param.Scale}}:END')
parameters:
Scale: 5.5
Loading