Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[If-diff] Only first array member is validated #734

Closed
MariamKhalatova opened this issue May 21, 2024 · 1 comment · Fixed by #711
Closed

[If-diff] Only first array member is validated #734

MariamKhalatova opened this issue May 21, 2024 · 1 comment · Fixed by #711
Assignees
Labels
bug Error, flaw or fault
Milestone

Comments

@MariamKhalatova
Copy link
Contributor

Description of the Error

Arrays inside manifests are not validated correctly.
Only the first member of an array is validated.

Expected Behaviour

All array members should be verified.

Actual Behaviour

Only the first member of an array is validated.

Steps to Reproduce

  1. Run the following manifest as a source.
name: basic
description: >-
  a minimal manifest executing a single plugin on a single component for a
  single timestep
tags: null
initialize:
  plugins:
    teads-curve:
      path: '@grnsft/if-unofficial-plugins'
      method: TeadsCurve
      global-config:
        interpolation: spline
  outputs:
    - yaml
execution:
  command: a
  environment:
    date-time: a
    if-version: v0.3.2
    os: macOS
    os-version: '13.2'
    node-version: 18.14.2
    dependencies:
      - '@babel/core@7.22.10'
      - '@babel/preset-typescript@7.23.3'
      - '@commitlint/cli@18.6.0'
      - '@commitlint/config-conventional@18.6.0'
      - '@grnsft/if-plugins@v0.3.2 extraneous -> file:../../../../if-models'
      - >-
        @grnsft/if-unofficial-plugins@v0.3.1 extraneous ->
        file:../../../../if-unofficial-models
      - '@jest/globals@29.7.0'
      - '@types/jest@29.5.8'
      - '@types/js-yaml@4.0.9'
      - '@types/luxon@3.4.2'
      - '@types/node@20.9.0'
      - csv-stringify@6.4.6
      - fixpack@4.0.0
      - gts@5.2.0
      - husky@8.0.3
      - jest@29.7.0
      - js-yaml@4.1.0
      - luxon@3.4.4
      - release-it@16.3.0
      - rimraf@5.0.5
      - ts-command-line-args@2.5.1
      - ts-jest@29.1.1
      - typescript@5.2.2
      - winston@3.11.0
      - zod@3.22.4
  status: success
tree:
  children:
    child-0:
      defaults:
        cpu/thermal-design-power: 100
      pipeline:
        - teads-curve
      inputs:
        - timestamp: 2023-07-06T00:00
          duration: 1
          cpu/utilization: 20
        - timestamp: 2023-07-06T00:01
          duration: 1
          cpu/utilization: 80
        - timestamp: 2023-07-06T00:02
          duration: 1
          cpu/utilization: 20
      outputs:
        - timestamp: 2023-07-06T00:00
          duration: 
          cpu/utilization: 20
          cpu/thermal-design-power: 100
          cpu/energy: 0.000013270071138211382
        - timestamp: 2023-07-06T00:01
          duration: 
          cpu/utilization: 80
          cpu/thermal-design-power: 100
          cpu/energy: 0.000025568089430894314
        - timestamp: 2023-07-06T00:02
          duration: 1
          cpu/utilization: 20
          cpu/thermal-design-power: 100
          cpu/energy: 0.000013270071138211382

and this one as a target

name: basic
description: >-
  a minimal manifest executing a single plugin on a single component for a
  single timestep
tags: null
initialize:
  plugins:
    teads-curve:
      path: '@grnsft/if-unofficial-plugins'
      method: TeadsCurve
      global-config:
        interpolation: spline
  outputs:
    - yaml
execution:
  command: a
  environment:
    date-time: a
    if-version: v0.3.2
    os: macOS
    os-version: '13.2'
    node-version: 18.14.2
    dependencies:
      - '@babel/core@7.22.10'
      - '@babel/preset-typescript@7.23.3'
      - '@commitlint/cli@18.6.0'
      - '@commitlint/config-conventional@18.6.0'
      - '@grnsft/if-plugins@v0.3.2 extraneous -> file:../../../../if-models'
      - >-
        @grnsft/if-unofficial-plugins@v0.3.1 extraneous ->
        file:../../../../if-unofficial-models
      - '@jest/globals@29.7.0'
      - '@types/jest@29.5.8'
      - '@types/js-yaml@4.0.9'
      - '@types/luxon@3.4.2'
      - '@types/node@20.9.0'
      - csv-stringify@6.4.6
      - fixpack@4.0.0
      - gts@5.2.0
      - husky@8.0.3
      - jest@29.7.0
      - js-yaml@4.1.0
      - luxon@3.4.4
      - release-it@16.3.0
      - rimraf@5.0.5
      - ts-command-line-args@2.5.1
      - ts-jest@29.1.1
      - typescript@5.2.2
      - winston@3.11.0
      - zod@3.22.4
  status: success
tree:
  children:
    child-0:
      defaults:
        cpu/thermal-design-power: 100
      pipeline:
        - teads-curve
      inputs:
        - timestamp: 2023-07-06T00:00
          duration: 1
          cpu/utilization: 20
        - timestamp: 2023-07-06T00:01
          duration: 1
          cpu/utilization: 80
        - timestamp: 2023-07-06T00:02
          duration: 1
          cpu/utilization: 20
      outputs:
        - timestamp: 2023-07-06T00:00
          duration: 1
          cpu/utilization: 20
          cpu/thermal-design-power: 100
          cpu/energy: 0.000013270071138211382
        - timestamp: 2023-07-06T00:01
          duration: 1
          cpu/utilization: 80
          cpu/thermal-design-power: 100
          cpu/energy: 0.000025568089430894314
        - timestamp: 2023-07-06T00:02
          duration: 1
          cpu/utilization: 20
          cpu/thermal-design-power: 100
          cpu/energy: 0.000013270071138211382

  1. See following result
> @grnsft/if@v0.3.2 if-diff
> npx ts-node src/diff.ts -s manifests/outputs/basic.yaml -t manifests/outputs/basic-1.yaml.yaml

Files match!
@MariamKhalatova MariamKhalatova added bug Error, flaw or fault qa labels May 21, 2024
@MariamKhalatova MariamKhalatova linked a pull request May 21, 2024 that will close this issue
9 tasks
@jmcook1186
Copy link
Contributor

ok took me a few attempts to repro this from the error report.
The manifests as they are provided here run with the expected behaviour, however if you correct the first missing duration value in the target but persist the second missing duration in the target you expect an error response but receive a success response, indicating that only the first entry in outputs is being diff'd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Error, flaw or fault
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants