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

Added --dry-run and merged --verbose. #303

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

dblock
Copy link
Member

@dblock dblock commented May 31, 2024

Description

Expanded the meaning of --verbose.

By default the test runner only outputs the story line.

$ npm run test:spec

PASSED  This story tests all endpoints relevant to the lifecycle of an index, from creation to deletion. (/Users/dblock/source/opensearch-project/opensearch-api-specification/dblock-opensearch-api-specification/tests/index_lifecycle.yaml)

With --verbose you now get the full detail in addition to the old behavior of dumping the HTTP responses. This makes skip_components unnecessary.

$ npm run test:spec -- --verbose

PASSED  This story tests all endpoints relevant to the lifecycle of an index, from creation to deletion. (/Users/dblock/source/opensearch-project/opensearch-api-specification/dblock-opensearch-api-specification/tests/index_lifecycle.yaml)
    PASSED  CHAPTERS 
        PASSED  Create an index named `books` with mappings and settings. 
            PASSED  PARAMETERS 
                PASSED  index 
            PASSED  REQUEST BODY 
            PASSED  RESPONSE STATUS 
            PASSED  RESPONSE PAYLOAD 
  ....

Added --dry-run

Added --dry-run that evaluates chapters but skips execution. This is particularly useful for tests.

$ npm run test:spec -- --dry-run

SKIPPED This story tests all endpoints relevant to the lifecycle of an index, from creation to deletion. (/Users/dblock/source/opensearch-project/opensearch-api-specification/dblock-opensearch-api-specification/tests/index_lifecycle.yaml)

Or to see everything that would be run.

$ npm run test:spec -- --dry-run --verbose

SKIPPED This story tests all endpoints relevant to the lifecycle of an index, from creation to deletion. (/Users/dblock/source/opensearch-project/opensearch-api-specification/dblock-opensearch-api-specification/tests/index_lifecycle.yaml)
    SKIPPED CHAPTERS 
        SKIPPED Create an index named `books` with mappings and settings. (Dry Run)
        SKIPPED Create an index named `games` with default settings, (Dry Run)
        SKIPPED Check if the index `books` exists. It should. (Dry Run)
        SKIPPED Check if the index `movies` exists. It should not. (Dry Run)
        SKIPPED Retrieve the mappings and settings of the `books` and `games` indices. (Dry Run)
        SKIPPED Close the `books` index. (Dry Run)
        SKIPPED Open the `books` index. (Dry Run)
        SKIPPED Delete the `books` and `games` indices. (Dry Run)
    SKIPPED EPILOGUES 
        SKIPPED DELETE /books (Dry Run)
        SKIPPED DELETE /games (Dry Run)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

github-actions bot commented May 31, 2024

Changes Analysis

Commit SHA: 3cd27ef
Comparing To SHA: 7a0d9f5

API Changes

Summary

NO CHANGES

Report

The full API changes report is available at: https:/opensearch-project/opensearch-api-specification/actions/runs/9375721494/artifacts/1568952743

API Coverage

Before After Δ
Covered (%) 476 (46.62 %) 476 (46.62 %) 0 (0 %)
Uncovered (%) 545 (53.38 %) 545 (53.38 %) 0 (0 %)
Unknown 24 24 0

Xtansia
Xtansia previously approved these changes Jun 3, 2024
Copy link
Collaborator

@Xtansia Xtansia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dblock dblock force-pushed the dry-run-and-verbose branch 2 times, most recently from 32dcd96 to f0023d2 Compare June 4, 2024 02:24
@dblock
Copy link
Member Author

dblock commented Jun 4, 2024

Rebased, @nhtruong take a look pls?

@Xtansia Xtansia merged commit 6f71b12 into opensearch-project:main Jun 4, 2024
6 checks passed
@dblock dblock deleted the dry-run-and-verbose branch June 7, 2024 14:58
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.

2 participants