SpiNNakerManchester / PACMAN

Partition and Configuration Manager for SpiNNaker
Apache License 2.0
9 stars 7 forks source link

reset_configs #392

Closed Christian-B closed 3 years ago

Christian-B commented 3 years ago

This is a f fix due to unittest not being able to find the default configs.

Short story:

If a unitest depends on a config add.

def setUp(self):
    reset_configs()

Where the reset_configs() comes from the config_setup,py in that repository

Longer story

The get_config... calls normally just return a config value loaded when sim.setup() is run If no sim.setup is run they will load configs logging a warning

To be able to load configs they have to know where they are.

The config files are added by a chain of add_xyz_cfg in each config_setup,py

The local reset_config() will

  1. clear any previous configs
  2. call that change to define where the configs are.

Locally and in actions 1 unittest may find the config files from another test but to depend on this causes an BAD order dependency in tests. Jenkins appears not to have the configs from a previous test available.

This explanation will be written up in the docs.