Simulink Tests fail in CI/CD pipeline "You cannot log ..." error

8 visualizzazioni (ultimi 30 giorni)
I have a model and set of CI/CD pipelines that perform a number of automations including running model advisor, running simulink test, and generating code. As this is part of a larger model based design effort at my employer, we have started standardizing things like model configurations. The current change I am working on is putting in a reference to our standard model configs in this project.
We have 4 standard configs stored in the dictionary, and one ref to those configs. We switch where the ref is pointing based on project needs:
We dont store this standard config directly in our repo for a given project (since it is part of a common repo) we suck this file in during our pipelines. We do run a small script that essentially "configures" our project (by switching the ref to the correct config) and saves/closes any open dictionaries after the script runs. Adding a call to this script seems to be what causes the issue.
This is what is in the configureModelFiles script:
setModelConfig('floating', 'cpp');
Simulink.data.dictionary.closeAll('-save');
I run the following batch command in the pipeline to perform testing:
matlab -batch "proj = openProject('<projectfile>'); ac = ArtifactoryController(); ac.installConfigDictionaryToProject(); addpath(genpath('.\dict-lib')); configureModelFiles; runTests;"
When running this I get the following error for each test:
An error occurred ('Simulink:Logging:CannotLogFuncCallMergeActionStateSignals') when calling 'sim':
Unable to log output of '<model name>', port '1'. You cannot log function-call signals, action signals, state signals, or signals that feed into a Merge block.
This error does not occur running the same scripts on my local system or running the scripts myself on the remote agent that runs pipelines. Is there something I am missing with the config changes? Should I not be doing that with the project already open? Could this be an issue of timing? Is there a setting in the config that is maybe affecting this error?

Risposta accettata

Justin Fitzpatrick
Justin Fitzpatrick il 14 Dic 2021
In case anyone comes across this later - do not try to run your Azure DevOps agents that run matlab tasks as a windows service user. Even in "batch" mode, MATLAB depends heavily on user space in windows, so running the service under an actual user account fixes this issue.

Più risposte (0)

Categorie

Scopri di più su Results, Reporting, and Test File Management in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by