FFFF How to retry only critical errors? · Issue #944 · gemini-testing/gemini · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

How to retry only critical errors? #944

Open

Description

@Astimus

Hello.
Right now retry works on critical errors and on failed diff. How to retry only on critical errors? Is there any workaround?

Activity

  1. unekhriukova commented on Jan 14, 2019

    @unekhriukova

    I have the same question. I tried to make a workaround by emitting the Events.RETRY event, but that does not work. Maybe, guys, you can give some advice on that also.

    'use strict';
    
    const Gemini = require('gemini/api');
    const Events = require('gemini/lib/constants/events');
    const handleErrors = require('gemini/lib/cli/errors').handleErrors;
    
    class GeminiCi {
      constructor() {
        let gemini = new Gemini();
        gemini.on(Events.ERROR, (err) => {
          if( err.name === 'GeminiError' ) {
            process.exit(handleErrors(err));
          } else {
            gemini.emit(Events.RETRY, Object.assign(err, {attempt: 0, retriesLeft: 1}));
          }
        });
        return gemini.test([], { reporters: [{ name: 'flat' }]})
          .then(stats => stats.failed > 0 ? 1 : 0);
      }
    }
    
    new GeminiCi();
    

    "gemini": "5.9.1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0