KeyError in test scheduler when using TestBench.scan_tests_from_file()
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
Direzione di ricerca
Inizia in runner.py, in TestScheduler._create_test_suite_sets, e segui come i nomi dei file restituiti da TestBench.scan_tests_from_file() vengono associati alla mappa delle dipendenze. Esegui due volte l’esempio allegato con python run.py per riprodurre l’errore. Il lavoro è completo quando la seconda esecuzione non genera più un KeyError per il percorso relativo e la prioritizzazione dei test continua a funzionare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Since test prioritization (08b2a6d2), the second run of a test bench whose tests are scanned via scan_tests_from_file() crashes with KeyError in TestScheduler._create_test_suite_sets (runner.py) when the file name is not spelled exactly like the project source file name (absolute, native str). A relative path, a pathlib.Path or a posix-style path on Windows all trigger it. The first run passes because there is no test history yet.
Reproduce: attached example, run python run.py twice.
Expected: scan_tests_from_file() normalizes the file name (or resolves it to the project source file), or the scheduler tolerates unknown file names.
run.py
from pathlib import Path
from vunit import VUnit
ROOT = Path(__file__).parent
vu = VUnit.from_argv()
vu.add_vhdl_builtins()
lib = vu.add_library("lib")
lib.add_source_files(ROOT / "*.vhd") # added with absolute paths
tb = lib.test_bench("tb_top")
# Same file, but spelled as a relative path -> not a key of the dependency map
tb.scan_tests_from_file("tests.vhd")
vu.main()
tb_top.vhd
library vunit_lib;
context vunit_lib.vunit_context;
-- Test bench without tests of its own: the test cases live in tests.vhd
-- (legacy structure supported via TestBench.scan_tests_from_file()).
entity tb_top is
generic (runner_cfg : string);
end entity;
architecture tb of tb_top is
begin
i_tests : entity work.tests
generic map (nested_runner_cfg => runner_cfg);
end architecture;
test.vhd
library vunit_lib;
context vunit_lib.vunit_context;
entity tests is
generic (nested_runner_cfg : string);
end entity;
architecture a of tests is
begin
main : process
begin
test_runner_setup(runner, nested_runner_cfg);
while test_suite loop
if run("test_a") then
check_true(true);
elsif run("test_b") then
check_true(true);
end if;
end loop;
test_runner_cleanup(runner);
end process;
end architecture;
- Lingua principale
- VHDL
- Stelle
- 850
- Fork
- 305
- Merge medio
- 2g 10h
- PR unite (30g)
- 7
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di VUnit/vunit
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
GHDL: generics leak between configurations when `ghdl.sim_flags` is setForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
VUnit/vunit#1223 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
AXI slave VCs have identical stalling behaviorForse già presa @Lay007 l’ha presa 28 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
VUnit/vunit#1219 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertadifficulty:2 enhancement good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
MakazhanAlpamys/Soup#2178 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Snapshot capture failure (EPERM spawning git) fails the whole step despite the best-effort contractForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertareproduced
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
anomalyco/opencode#58685 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
JakeChampion/lang#13132 ·
I maintainer di solito rispondono entro 1 giorno