Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix RELEASE file parsing - fixes #228 #239

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ibek/support_cmds/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
SHELL_REPLACE = r"${\1}"

# find macros, including ones with blank values
PARSE_MACROS_NULL = re.compile(r"^([A-Z_a-z0-9]*)\s*=(.*)$", flags=re.M)
PARSE_MACROS_NULL = re.compile(r"^([A-Z_\-\.a-z0-9]*)\s*=(.*)$", flags=re.M)


def verify_release_includes_local(configure_folder: Path):
Expand Down
3 changes: 2 additions & 1 deletion tests/samples/epics/support/configure/RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ SUPPORT=/epics/support
EPICS_BASE=/epics/epics-base

# Additional Support Modules for individual IOCs will be added below this line
ADSIMDETECTOR=/epics/support/ADSimDetector
ADSIMDETECTOR=/epics/support/ADSimDetector
SOME-OTHER-MODULE=/epics/support/some-other-module
Empty file.
23 changes: 21 additions & 2 deletions tests/test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from ibek.support_cmds.checks import check_deps
from ibek.support_cmds.checks import check_deps, do_dependencies
from ibek.support_cmds.files import symlink_files


Expand Down Expand Up @@ -38,8 +38,27 @@ def test_symlink_pvi(tmp_path: Path, samples: Path):
# the support files
def test_check_dependencies(tmp_epics_root: Path):
# Check Passes vs test data
check_deps(["ADSimDetector"])
check_deps(["ADSimDetector", "some-other-module"])

# Check fails
with pytest.raises(Exception):
check_deps(["FakeDetector"])


def test_check_release_sh(tmp_epics_root: Path):
"""validate generation of RELEASE.sh for issue #227"""

do_dependencies()

release_sh = tmp_epics_root / "support" / "configure" / "RELEASE.shell"
assert release_sh.exists()
text = release_sh.read_text()
assert (
text
== """export SUPPORT="/epics/support"
export EPICS_BASE="/epics/epics-base"
export ADSIMDETECTOR="/epics/support/ADSimDetector"
export SOME-OTHER-MODULE="/epics/support/some-other-module"
export EPICS_DB_INCLUDE_PATH=""
"""
)
Loading