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

Generated JSON does not include test report key #17

Open
m4dc4p opened this issue Oct 5, 2022 · 1 comment
Open

Generated JSON does not include test report key #17

m4dc4p opened this issue Oct 5, 2022 · 1 comment

Comments

@m4dc4p
Copy link
Contributor

m4dc4p commented Oct 5, 2022

The JSON generated for a job containing a test report does NOT include that report (even though it is specified in the Dhall source). (The JSON should contain a artifacts:report:sjunit value as specified at https://docs.gitlab.com/ee/ci/yaml/index.html#artifactsreports.)

For example, this (intended to be run from the top-level directory):

let GitLab =./package.dhall

let Prelude = GitLab.Prelude

let renderTop = GitLab.Top.toJSON

let When = GitLab.When.Type

let jobWithReport =
      GitLab.Job::{
      , stage = Some "build"
      , image = Some { name = "alpine:latest", entrypoint = Some [ " " ] }
      , script = [ "echo 'Hello World'" ]
      -- generated JSON will include NOT "reports" key
      , artifacts = Some
            { when = When.Always
                  , expire_in.seconds = 365 * 24 * 60 * 60
                  , paths = [ "report.xml" ]
                  , reports = { junit = Some "report.xml" }
            }
      }

let top = GitLab.Top::{ jobs = toMap { 
      job-with-report = jobWithReport
} }

in  Prelude.JSON.renderYAML (renderTop top)

produces the following JSON, which does NOT include the artifacts:reports:junit key:

"job-with-report":
  "allow_failure": false
  "artifacts":
    "expire_in": "31536000 second"
    "paths":
      - "report.xml"
    "when": "always"
  "image":
    "entrypoint":
      - " "
    "name": "alpine:latest"
  "script":
    - "echo 'Hello World'"
  "stage": "build"
  "variables": {}
"variables":
  "GIT_SUBMODULE_STRATEGY": "normal"
@m4dc4p
Copy link
Contributor Author

m4dc4p commented Oct 5, 2022

See #18 for a fix. Note that the reports key will NOT appear in the output if no value is given (so existing files should not see any change, except more correct output.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant