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

pest --ci option doesn't exist and no-ops? #285

Open
bluesheep100 opened this issue Sep 18, 2024 · 2 comments
Open

pest --ci option doesn't exist and no-ops? #285

bluesheep100 opened this issue Sep 18, 2024 · 2 comments

Comments

@bluesheep100
Copy link
Contributor

I was going to set up CI/CD with Pest to help enforce keeping expectations up to date. However, the guide is rather confusing, as I can't find out what ./vendor/bin/pest --ci would do differently to just ./vendor/bin/pest, due to there seemingly being no mention of what this --ci option does anywhere.
Maybe I'm just blind, but I really can't find it, and running the command with --ci doesn't make any visible difference in output.

@JHWelch
Copy link
Contributor

JHWelch commented Sep 18, 2024

From a quick search in the codebase, it only seems to set the Environment::name() to a CI constant.

And then that is only used in whether it creates a lockfile

    /**
     * Creates the lock file.
     */
    public static function enable(TestCall $testCall, string $group = '__pest_only'): void
    {
        $testCall->group($group);

        if (Environment::name() === Environment::CI || Parallel::isWorker()) {
            return;
        }

        $lockFile = self::TEMPORARY_FOLDER.DIRECTORY_SEPARATOR.'only.lock';

        if (file_exists($lockFile) && $group === '__pest_only') {
            file_put_contents($lockFile, $group);

            return;
        }

        if (! file_exists($lockFile)) {
            touch($lockFile);

            file_put_contents($lockFile, $group);
        }
    }

@bluesheep100
Copy link
Contributor Author

Well, I guess that's a reason to use the flag, though I'm not sure what a lockfile does in the context of a testing framework. I only know composer.lock and such.
Is it just to prevent mid-runtime configuration changes or something?

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

No branches or pull requests

2 participants