ci: run the unit tests outside flow/test

Ouverte
#4,808 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
35/100
Type d'issue
Refactorisation
Clarté
Plutôt claire
Activité
Active
Stack technique
github-actions, python
Domaine
ci-cd, testing

Piste de recherche

Read .github/workflows/github-actions-cron-util-test.yml and the listed test paths to understand what CI currently runs and how each suite is invoked. The issue frames the change as a policy decision about test placement and CI coverage; first establish the project’s decision on those questions. Done means the agreed tests run from CI on relevant path changes, including the FakeRAM2.0 runner if that suite is included.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

enhancement
Description

Not urgent, just documenting a chore. I tried to clean this up in a PR but I think this is more of a policy decision than coding work these days.

The Test Util Scripts workflow (.github/workflows/github-actions-cron-util-test.yml) runs flow/test/*.py. Some unit tests elsewhere in the tree are not run by CI, so they are run on demand and can break unnoticed:

Tests Cover Runner
flow/scripts/memories/{detect,gen_memories,idiomatic,schema}_test.py AUTO_MEMORIES none
flow/util/genMetrics_test.py genMetrics.py none
tools/FakeRAM2.0/test/*_test.py FakeRAM2.0 tools/FakeRAM2.0/test/test_all.sh

All of them pass on master (9ca2a9e7).

#4807 tried to fix this by documenting these tests as run on demand, and was closed. Moving them is little coding now that an AI can do the edit; what is open is policy:

  • Does every unit test in the tree run in CI?
  • Do unit tests live in flow/test/, where CI and contributors find them, or next to the code they cover?
  • Does a vendored tool such as FakeRAM2.0 keep its own suite and runner, called from the workflow?
Suggested Solution

If the answers are yes, in flow/test/, and yes:

  • Move the memories tests and genMetrics_test.py into flow/test/ as test_<name>.py. They use only the Python standard library (plus git for genMetrics_test.py), so the workflow needs nothing installed. Each reaches the code under test the way flow/test/test_convertDrc.py already does, a sys.path entry for ../scripts/memories or ../util.
  • Add flow/scripts/memories/*.py to the workflow's paths triggers. Today a pull request that changes only that directory does not run the workflow.
  • Run tools/FakeRAM2.0/test/test_all.sh as a workflow step instead of moving its tests: its tests import FakeRAM2.0's modules relative to tools/FakeRAM2.0, and the suite has its own runner. Add tools/FakeRAM2.0/** to the triggers.
Additional Context

The workflow's loop, for file in *.py; do python3 "$file"; done, runs under the GitHub Actions default bash -e, so it stops at the first failing test.

Langage dominant
Verilog
Étoiles
836
Forks
566
Merge moyen
2 j 15 h
PR mergées (30 j)
84

Préparer son environnement

  • Fournit un Dockerfile ou un fichier Docker Compose
  • Aucun modèle de pull request
  • Aucun guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de The-OpenROAD-Project/OpenROAD-flow-scripts

Toutes les issues de The-OpenROAD-Project/OpenROAD-flow-scripts

Issues similaires

Plus d'issues DevOps

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.