GithubHelp home page GithubHelp logo

Write a Github Action that runs the static analysis tests as described in the https://developer.adobe.com/commerce/testing/guide/static/ about mageos-magento2 HOT 7 OPEN

mage-os avatar mage-os commented on June 8, 2024 1
Write a Github Action that runs the static analysis tests as described in the https://developer.adobe.com/commerce/testing/guide/static/

from mageos-magento2.

Comments (7)

damienwebdev avatar damienwebdev commented on June 8, 2024

Assigning @DavidLambauer

from mageos-magento2.

DavidLambauer avatar DavidLambauer commented on June 8, 2024

To be clear, the expected outcome of this issue is to have a GitHub workflow running all the static tests (passing) and publish the build reports. correct?

from mageos-magento2.

damienwebdev avatar damienwebdev commented on June 8, 2024

@DavidLambauer I'm not particularly interested in the build report being publicly accessible in a "pretty format". Whatever the job outputs in CI is enough for me.

from mageos-magento2.

DavidLambauer avatar DavidLambauer commented on June 8, 2024

I started working on this one. Doing some notes-taking here. Don't mind it, yet.

  • I use the graycoreio/github-actions-magento2/supported-version@main to generate the matrix for the currently supported Magento 2 Versions. This action spits out a JSON with all the different PHP/Magento(And most likely more than that) combinations. Then, I can use that output in graycoreio/github-actions-magento2/setup-magento@main to setup a Magento with the parameters that I got from the step before.
  • I wonder if the Matrix is cached somewhere globally, so I can memorize it instead of wasting resources on it?
  • The above setup results in a couple of different jobs. All of them are named similar and a suffix is added. Something like this: setup-magento-extension (magento/project-community-edition:>=2.4.4 <2.4.5). The UI for this is horrible. I wonder if we can simplify the name generation somehow. Something like Magento 2.4.4 / PHP 8.1 would make more sense.

CleanShot 2022-11-07 at 20 13 44

from mageos-magento2.

DavidLambauer avatar DavidLambauer commented on June 8, 2024

The env variables for graycoreio/github-actions-magento2/setup-magento@main are a little bit confusing. In particular:

  • There is a mode extension, and there is extensions. extensions refers to the PHP Extensions, so the naming could be php_extensions to make it more clear. The extensions variable does not affect anything right now; it is not used further.
  • The coverage variable expects something like xDebug and not a simple true/false. I had to read the description twice to get it. Either, the description or the naming should be improved here.
  • Some vars are named in snake_case, and some in kebab-case.

from mageos-magento2.

DavidLambauer avatar DavidLambauer commented on June 8, 2024

I have something running as a first draft. As I mentioned, I use the setup-magento actions to get all the different Magento/PHP Combos. Then, I run composer install and run the tests with cd dev/tests/static && php ./../../../vendor/bin/phpunit . testsuite/Magento/Test/Legacy testsuite/Magento/Test/Integrity.

I am not entirely sure what Tests run in Magento. When I look at this I see several static test suites. Digging deeper into the test results from Static tests for CE I can see the Allure Report, but it only mentions Integrity tests.

My latest version: https://github.com/DavidLambauer/mageos-magento2/actions/runs/3414702008/jobs/5682998132

from mageos-magento2.

DavidLambauer avatar DavidLambauer commented on June 8, 2024

Summary of what was done so far:

  • I set up a Workflow that spins up Magento Instances in several different Version Combinations. I use graycoreio/github-actions-magento2/supported-version@main.
  • The Workflow is available here: https://github.com/DavidLambauer/mageos-magento2/actions
  • The Matrix from @damienwebdev spins up 8 different Jobs
  • Each Job spins up a clean Mage-OS
  • Each Job runs the following tests:
    • PHPUnit in dev/tests/unit
    • Integration Integrity Tests from dev/tests/integration/testsuite/Magento/Test/Integrity
    • Legacy Tests in dev/tests/static/testsuite/Magento/Test/Legacy
    • Static Tests in dev/tests/static

I have a couple of open todos and questions:

  • The Matrix compilation should be cached somehow
  • I need some help with the Workflow structure. Right now, everything is just clustered into this single Workflow file. I am sure we need smaller components not to run EVERYTHING ALWAYS.
  • All the tests fail right now. Yet, I don't rely on the phpunit.xml rulesets. I tried reverse engineering the bin/magento dev:tests:run ... command and ended up with an execution that ignores the rulesets.
  • The test output from the Allure Report for Static CE Tests mentions 4018 Tests, whereas my current test suite only contains 3824 tests. Am I missing some?
  • I don't like the current execution. Static tests should be categorized into execution tools. So instead of having one big Static Tests Block, I would go with one for phpmd, phpstan, Copy/Paste Detector, etc...
  • The Allure Reports from Magento right now seem to be broken. They don't list all the test sites but only the integrity tests. This would be nice to have running over all the different test results.
  • The Tests run forever... I can't believe that a single static test run takes more than 3h... Big Yikes...

from mageos-magento2.

Related Issues (10)

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.