You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I currently run the CI on my PC and the reference files are placed in a directory that has the following relative path starting from the python script directory:
When I run the script the relative path is not resolved and it is copied "as is" in the .json file that is used by the testModel.py script, with the result that the reference variables are not found by omc.
It seems that the cause of this is the following code recently added to the test.py script:
if isinstance(c["referenceFiles"], (str, bytes)):
m = re.search("^[$][A-Z]+", c["referenceFiles"])
if m:
k = m.group(0)[1:]
if k not in os.environ:
raise Exception("Environment variable %s not defined, but used in JSON config for reference files" % k)
c["referenceFiles"] = c["referenceFiles"].replace(m.group(0), os.environ[k])
that refuses my path because it is a string that not respect the requirments of the regular expression (i.e., is is not an environment variable)
I think there might be an error in the indentation of the second elif case:
if isinstance(c["referenceFiles"], (str, bytes)):
m = re.search("^[$][A-Z]+", c["referenceFiles"])
if m:
k = m.group(0)[1:]
if k not in os.environ:
raise Exception("Environment variable %s not defined, but used in JSON config for reference files" % k)
c["referenceFiles"] = c["referenceFiles"].replace(m.group(0), os.environ[k])
elif "giturl" in c["referenceFiles"]:
refFilesGitTag = "origin/master"
if "git-ref" in c["referenceFiles"]:
refFilesGitTag = c["referenceFiles"]["git-ref"].strip()
.... etc
that never is tested if c["referenceFiles"] is a string, maybe the right indentation is the following,
if isinstance(c["referenceFiles"], (str, bytes)):
m = re.search("^[$][A-Z]+", c["referenceFiles"])
if m:
k = m.group(0)[1:]
if k not in os.environ:
raise Exception("Environment variable %s not defined, but used in JSON config for reference files" % k)
c["referenceFiles"] = c["referenceFiles"].replace(m.group(0), os.environ[k])
elif "giturl" in c["referenceFiles"]:
refFilesGitTag = "origin/master"
if "git-ref" in c["referenceFiles"]:
refFilesGitTag = c["referenceFiles"]["git-ref"].strip()
.... etc
that probably solves also this issue.
The text was updated successfully, but these errors were encountered:
AndreaBartolini
changed the title
existing local path for reference files not accepted
Existing local relative path for reference files is not accepted
Mar 4, 2024
AndreaBartolini
changed the title
Existing local relative path for reference files is not accepted
Existing local relative path for reference files is not resolved
Mar 4, 2024
I currently run the CI on my PC and the reference files are placed in a directory that has the following relative path starting from the python script directory:
../../LibRefResults/zLibTest2
my config file is the following:
When I run the script the relative path is not resolved and it is copied "as is" in the
.json
file that is used by thetestModel.py
script, with the result that the reference variables are not found by omc.It seems that the cause of this is the following code recently added to the
test.py
script:that refuses my path because it is a string that not respect the requirments of the regular expression (i.e., is is not an environment variable)
I think there might be an error in the indentation of the second
elif
case:that never is tested if c["referenceFiles"] is a string, maybe the right indentation is the following,
that probably solves also this issue.
The text was updated successfully, but these errors were encountered: