Coder Social home page Coder Social logo

Comments (5)

GrzegorzDrozd avatar GrzegorzDrozd commented on August 17, 2024 6

Hi,

I did some changes in the way task files are generated and i noticed that issue today. Temporary fix is to add

\Codeception\Configuration::config();

into RoboFile.php like this:

    /**
     * Split tests into separate groups. Tests are split by file not by test.
     */
    public function parallelSplitTests()
    {
        \Codeception\Configuration::config();

        // Split your tests by files
        $this->taskSplitTestsByGroups($this->numberOfExecutors)
             ->testsFrom('tests/acceptance')
             ->projectRoot('.')
             ->groupsTo('tests/_data/paracept_')
             ->run();
    }

I will create PR with fix as soon as I know why this is happening. Side note: it was working fine for me for months and then it stopped.
It is because codecept_relative_path is resolving paths against project dir and that is not set until Configuration::config() is executed.

As I said: I will try to solve that in code as soon as I can.

from robo-paracept.

bnpatel1990 avatar bnpatel1990 commented on August 17, 2024

This is probably not the best approach but gets the work done for me. This is how I use taskSplitTestsByGroups and then later perform a cleanup on it.

so this is how it looks on my end

    public function parallelSplitTests()
    {
        $this->taskSplitTestsByGroups($this->count)
            ->projectRoot('.')
            ->testsFrom('tests')
            ->groupsTo('tests/_groups/robo/robo_')
            ->run();
        $this->groupCleanUp();
    }

    public function groupCleanUp()
    {
        foreach (new DirectoryIterator('tests/_groups/robo') as $file) {
            if ($file->isDot()) continue;

            $content = file_get_contents($file->getPathname());
            file_put_contents($file->getPathname(), '');

            $tests = explode("\n", $content);
            foreach ($tests as $test) {
                if (preg_match("/(.*)suite\//", $test))
                    $test = preg_split("/(.*)suite\//", $test) [1];
                file_put_contents($file->getPathname(), $test . "\n", FILE_APPEND | LOCK_EX);
            }
        }
    }

from robo-paracept.

vansari avatar vansari commented on August 17, 2024

Hi @richleland

can you please check if the error still exists with the newest version?

from robo-paracept.

richleland avatar richleland commented on August 17, 2024

Hi there - our team has stopped use of PHP altogether and we haven't used codeception/robo-paracept in a few years. I don't have the means to easily test this anymore so someone else will have to give it a whirl.

from robo-paracept.

vansari avatar vansari commented on August 17, 2024

Thanks a lot for your feedback @richleland

I will close this issue.

from robo-paracept.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.