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

Implement Option to Rerun Failed or Errored Tests in CQL Test Runner #12

Open
darkknight13 opened this issue Apr 26, 2024 · 1 comment · May be fixed by #20
Open

Implement Option to Rerun Failed or Errored Tests in CQL Test Runner #12

darkknight13 opened this issue Apr 26, 2024 · 1 comment · May be fixed by #20
Assignees
Labels
enhancement New feature or request

Comments

@darkknight13
Copy link
Contributor

This enhancement proposes adding functionality to the CQL Test Runner to rerun tests that have failed or encountered errors. This feature would enable developers to focus on retesting specific cases after addressing issues in their CQL engine. Presently, tests are executed sequentially for all cases without the ability to selectively rerun failed tests.

@brynrhodes brynrhodes added the enhancement New feature or request label Apr 29, 2024
@darkknight13
Copy link
Contributor Author

To rerun tests based on their status, I've planned to cache them in the file system and load them accordingly. For this purpose, I intend to encapsulate the tests within the following CQLTest class.

/**
 * Represents a CQL Test.
 */
class CQLTest {
    /**
     * Enum representing possible test statuses.
     * @enum {string}
     */
    static STATUS = {
        'PASS': 'pass',
        'FAIL': 'fail',
        'SKIP': 'skip',
        'ERROR': 'error',
    }

    /**
     * Creates an instance of CQLTest.
     * @param {string} tests - The type of test.
     * @param {string} group - The group of test.
     * @param {object} test - The test details.
     */
    constructor(tests, group, test) { }

    /**
     * Saves the test configuration to a file.
     * @param {string} directory - The directory to save the file.
     * @param {boolean} [force=false] - Whether to force saving even if the file already exists.
     * @returns {string|null} - The file save path, or null if directory is not provided.
     */
    save(directory, force = false) { }

    /**
     * Runs the test.
     * @param {string} apiUrl - The API URL to run the test against.
     * @returns {Promise<CQLTestResult>} - The result of the test.
     */
    async run(apiUrl) { }

    /**
     * Returns the JSON representation of the test.
     * @returns {object} - The JSON representation of the test.
     */
    toJSON() { }

    /**
     * Creates a CQLTest instance from a JSON configuration.
     * @param {object} config - The JSON configuration.
     * @returns {CQLTest} - The CQLTest instance.
     */
    static fromJSON(config) { }
}

@darkknight13 darkknight13 linked a pull request May 16, 2024 that will close this issue
@darkknight13 darkknight13 self-assigned this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants