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

test(supply-chain-app-backend): fix via-npm-script.test.ts hanging #3404

Conversation

petermetz
Copy link
Contributor

  1. The test case was hanging at the end because it was waiting for a
    magic string to appear in the logs to indicate that the booting has finished.
  2. The problems began when we changed the supply chain app's log message
    from mentioning Cactus to Cacti which then invalidated the condition forever.
  3. This left it hanging indefinitely and the test case was broken.
  4. Now to fix the problem and avoid this happening again in the future
    the supply chain app exports the log message pattern as a variable and the
    test case imports that directly so if we change the log message in the
    future it will automatically make sure that the test is also waiting for
    the updated log message pattern to show up in the logs making this class
    of bugs impossible to happen.

Signed-off-by: Peter Somogyvari [email protected]

Pull Request Requirements

  • Rebased onto upstream/main branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.
  • Have git sign off at the end of commit message to avoid being marked red. You can add -s flag when using git commit command. You may refer to this link for more information.
  • Follow the Commit Linting specification. You may refer to this link for more information.

Character Limit

  • Pull Request Title and Commit Subject must not exceed 72 characters (including spaces and special characters).
  • Commit Message per line must not exceed 80 characters (including spaces and special characters).

A Must Read for Beginners
For rebasing and squashing, here's a must read guide for beginners.

@petermetz petermetz force-pushed the test-fix-supply-chain-npm-cli-test-case branch from e7a53ac to 95d8084 Compare July 15, 2024 16:18
@petermetz petermetz disabled auto-merge July 15, 2024 16:26
1. The test case was hanging at the end because it was waiting  for a
magic string to appear in the logs to indicate that the booting has finished.
2. The problems began when we changed the supply chain app's log message
from mentioning Cactus to Cacti which then invalidated the condition forever.
3. This left it hanging indefinitely and the test case was broken.
4. Now to fix the problem and avoid this happening again in the future
the supply chain app exports the log message pattern as a variable and the
test case imports that directly so if we change the log message in the
future it will automatically make sure that the test is also waiting for
the updated log message pattern to show up in the logs making this class
of bugs impossible to happen.
5. Also sneaking in a hot-fix for a missing test coverage environment
variable for the test package of the manual consortium plugin which was
uncovered by this pull request's execution by chance.

Signed-off-by: Peter Somogyvari <[email protected]>
@petermetz petermetz force-pushed the test-fix-supply-chain-npm-cli-test-case branch from 95d8084 to b065cbc Compare July 15, 2024 16:41
@petermetz petermetz merged commit a9c7794 into hyperledger-cacti:main Jul 15, 2024
142 of 143 checks passed
@petermetz petermetz deleted the test-fix-supply-chain-npm-cli-test-case branch July 15, 2024 17:20
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

Successfully merging this pull request may close these issues.

3 participants