[NPMCLI-141] Investigate and fix cause for failing yamlHelper test on Jenkins Created: 11/Sep/17  Updated: 16/Nov/17  Resolved: 16/Nov/17

Status: Closed
Project: Magnolia CLI
Component/s: None
Affects Version/s: 2.2.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Federico Grilli Assignee: Federico Grilli
Resolution: Cannot Reproduce Votes: 0
Labels: regression
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to NPMCLI-145 Refactor code with Promises to avoid ... Open
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: CLI v3
Sprint: Basel 122
Story Points: 1

 Description   

A test has started failing only on Jenkins (works fine locally) after NPMCLI-138. The changes in that ticket look completely unrelated to the failure though. Most likely it's timing/async issue.

 1) should append components correctly when having spaces or comments and more than one area


  124 passing (49s)
  1 failing

  1) yamlHelper should append components correctly when having spaces or comments and more than one area:

      AssertionError: expected 'title: hello\ntemplateScript: /foo/templates/pages/baz.ftl\n  \nareas:\n  fooArea:\n    availableComponents:\n      baz:\n        id: foo:components/baz\n      meh:\n        id: foo:components/meh\n  bazArea:\n    availableComponents:\n      qux:\n      comp:\n        id: foo:components/comp\n        id: foo:components/qux\n' to equal 'title: hello\ntemplateScript: /foo/templates/pages/baz.ftl\n  \nareas:\n  fooArea:\n    availableComponents:\n      baz:\n        id: foo:components/baz\n      meh:\n        id: foo:components/meh\n  bazArea:\n    availableComponents:\n      qux:\n        id: foo:components/qux\n      comp:\n        id: foo:components/comp\n'
      + expected - actual

               id: foo:components/meh
         bazArea:
           availableComponents:
             qux:
      +        id: foo:components/qux
             comp:
               id: foo:components/comp
      -        id: foo:components/qux
      
      at Context.<anonymous> (test/yamlHelperTest.js:93:37)


 Comments   
Comment by Ewa Snopczynska-Sienczylo [ 22/Sep/17 ]

Cloud needs 2.2.0 version where support of CLI for cloud bundles was added.
We cannot use the feature until it's released.
https://jira.magnolia-cms.com/browse/NPMCLI-138

Comment by Federico Grilli [ 16/Nov/17 ]

This looks more like an async/timing issue (occurring on Jenkins where tests may run slower than locally) which would require refactoring, possibly by using ES6 Promises or plain callbacks in yamlHelper.js, so that different operations are chained and executed at the right time.
I would deem this issue totally unrelated to NPMCLI-138 and, since in practice we have had no issue in production with yamlHelper, I'd release CLI 2.2.0.

Generated at Mon Feb 12 04:46:55 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.