From 1676333c328117bc6848dd3cfa39646069fec16c Mon Sep 17 00:00:00 2001 From: Tannaz Vahidi Date: Mon, 2 Sep 2024 23:05:58 +0200 Subject: [PATCH 1/8] lobster-codebeamer supports refs upstream reference (#68) * lobster-codebeamer supports refs upstream reference An optional config file as argument has been added to lobster-codebeamer. This config file should include a list of upstream references and respective cb-fieldNames Resolves https://github.com/bmw-software-engineering/lobster/issues/45 --- CHANGELOG.md | 2 + lobster/tools/codebeamer/codebeamer.py | 89 ++++++++++++++++++++++ packages/lobster-tool-codebeamer/README.md | 27 +++++++ 3 files changed, 118 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de8ac552..8b17cb36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ### 0.9.18-dev +* The `lobster-codebeamer` tool now supports `refs` as an upstream reference + * The `lobster-online-report` tool now works with config files located in main- and submodules of a repository. This feature needs `git 1.7.8` or higher. diff --git a/lobster/tools/codebeamer/codebeamer.py b/lobster/tools/codebeamer/codebeamer.py index 3d1e4e5c..57ab9b02 100755 --- a/lobster/tools/codebeamer/codebeamer.py +++ b/lobster/tools/codebeamer/codebeamer.py @@ -41,6 +41,8 @@ import argparse import netrc from urllib.parse import quote +from enum import Enum +import json import requests from lobster.items import Tracing_Tag, Requirement @@ -49,6 +51,26 @@ from lobster.io import lobster_read, lobster_write +class References(Enum): + REFS = "refs" + + +SUPPORTED_REFERENCES = [References.REFS.value] + + +def add_refs_refrences(req, flat_values_list): + # refs + for value in flat_values_list: + if value.get("id"): + ref_id = value.get("id") + req.add_tracing_target(Tracing_Tag("req", str(ref_id))) + + +map_reference_name_to_function = { + References.REFS.value: add_refs_refrences +} + + def query_cb_single(cb_config, url): assert isinstance(cb_config, dict) assert isinstance(url, str) @@ -193,6 +215,30 @@ def to_lobster(cb_config, cb_item): text = None, status = status) + if cb_config.get('references'): + for reference_name, displayed_chosen_names in ( + cb_config['references'].items()): + if reference_name not in map_reference_name_to_function: + continue + + for displayed_name in displayed_chosen_names: + if cb_item.get(displayed_name): + flat_values_list = cb_item.get(displayed_name) if ( + isinstance(cb_item.get(displayed_name), list)) \ + else [cb_item.get(displayed_name)] + else: + flat_values_list = ( + list(value for custom_field + in cb_item["customFields"] + if custom_field["name"] == displayed_name and + custom_field.get("values") + for value in custom_field["values"])) + if not flat_values_list: + continue + + (map_reference_name_to_function[reference_name] + (req, flat_values_list)) + return req @@ -210,6 +256,36 @@ def import_tagged(mh, cb_config, items_to_import): return rv +def ensure_array_of_strings(instance): + if (isinstance(instance, list) and + all(isinstance(item, str) + for item in instance)): + return instance + else: + return [str(instance)] + + +def parse_cb_config(file_name): + assert isinstance(file_name, str) + assert os.path.isfile(file_name) + + with open(file_name, "r", encoding='utf-8') as file: + data = json.loads(file.read()) + + provided_config_keys = set(data.keys()) + supported_references = set(SUPPORTED_REFERENCES) + + if not provided_config_keys.issubset(supported_references): + raise KeyError("The provided references are not supported! " + "supported referenes: '%s'" % + ', '.join(SUPPORTED_REFERENCES)) + + json_config = {} + for key, value in data.items(): + json_config[key] = ensure_array_of_strings(value) + return json_config + + def main(): ap = argparse.ArgumentParser() @@ -217,10 +293,17 @@ def main(): modes.add_argument("--import-tagged", metavar="LOBSTER_FILE", default=None) + modes.add_argument("--import-query", metavar="CB_QUERY_ID", default=None) + ap.add_argument("--config", + help=("name of codebeamer " + "config file, supported references: '%s'" % + ', '.join(SUPPORTED_REFERENCES)), + default=None) + ap.add_argument("--ignore-ssl-errors", action="store_true", default=False, @@ -254,6 +337,12 @@ def main(): "timeout" : options.timeout, } + if options.config: + if os.path.isfile(options.config): + cb_config["references"] = parse_cb_config(options.config) + else: + ap.error("cannot open config file '%s'" % options.config) + if cb_config["root"] is None: ap.error("please set CB_ROOT or use --cb-root") diff --git a/packages/lobster-tool-codebeamer/README.md b/packages/lobster-tool-codebeamer/README.md index d5eb22fb..9c4b729c 100644 --- a/packages/lobster-tool-codebeamer/README.md +++ b/packages/lobster-tool-codebeamer/README.md @@ -13,6 +13,30 @@ requirements management tool * `lobster-codebeamer`: Extrat requirements from codebeamer. +## Configuration +This tool works with an optional config file. In it you can declare which +codebeamer fields should be used as 'refs' reference in the codebeamer file. + +For the 'refs' reference in config file you can write: + +``` +{ +"refs" : "cb-fieldname" +} +``` +or +``` +{ +"refs" : ["cb-fieldname"] +} +``` +or +``` +{ +"refs" : ["cb-fieldname1", "cb-fieldname2"] +} +``` + ## Usage There are two ways you can use this tool: @@ -23,6 +47,9 @@ There are two ways you can use this tool: * Download all requirements generated by a saved codebeamer query (using `--import-query`) +* Configure the 'refs' upstream reference (this argument is optional) +(using `--config`) + ## Limitations The key limitation is item text, which is currently not From 7c4ee42be930f0f2a80a3874edeb3c125330db7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Kl=C3=B6ffel?= <145490354+christophkloeffel@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:21:33 +0200 Subject: [PATCH 2/8] change codeowner team (#71) --- .github/CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 973c9957..99af9c5d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,6 +3,6 @@ # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, -# @bmw-software-engineering/maintainers will be requested for +# @bmw-software-engineering/trlc-lobster-maintainers will be requested for # review when someone opens a pull request. -* @bmw-software-engineering/maintainers +* @bmw-software-engineering/trlc-lobster-maintainers From 9c9d8633190c7dcfa23e01db7bd9fc702e83b65f Mon Sep 17 00:00:00 2001 From: ankushsonare1 <161299113+ankushsonare1@users.noreply.github.com> Date: Fri, 13 Sep 2024 18:49:24 +0530 Subject: [PATCH 3/8] improve accessibility in LOBSTER html report (#34) * LOBSTER report does use more prominent colours * LOBSTER report add check-square svg * added new alert-triangale and check-square svg * remove white space in io.py and json.py * Update the colours as light green and red to purple * remove lobster.html and report.lobster files * Add switch case and flag for color blindness * Added project specific extensions in gitignore * Updated changelog entry for color blindness support and minor changes in script. * Make shorter text for help --------- Co-authored-by: DiFerMa --- .gitignore | 5 +++++ CHANGELOG.md | 3 +++ assets/alert-triangle.svg | 2 +- assets/check-square.svg | 2 +- lobster/io.py | 8 ++++---- lobster/tools/core/html_report.py | 12 ++++++++---- 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 577a53f2..f7f60576 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,8 @@ meta_dist test_install test_install_monolithic + +# Project ignores +.coverage* +*.lobster +*.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b17cb36..4254c93a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ resulting lobster file will now contain "Unset" as status information, too, instead of `Null`. +* The `lobster-html-report` tool now supports argument `--high-contrast` to use + a color palette with a higher contrast for easier visualization. + ### 0.9.17 * The `lobster-python` tool now adds the line number to the function diff --git a/assets/alert-triangle.svg b/assets/alert-triangle.svg index 6dcb0963..f636fa88 100644 --- a/assets/alert-triangle.svg +++ b/assets/alert-triangle.svg @@ -1 +1 @@ - \ No newline at end of file +! \ No newline at end of file diff --git a/assets/check-square.svg b/assets/check-square.svg index 72ab7a80..f4448ecb 100644 --- a/assets/check-square.svg +++ b/assets/check-square.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/lobster/io.py b/lobster/io.py index 48e2fa4f..22eb7292 100644 --- a/lobster/io.py +++ b/lobster/io.py @@ -125,9 +125,9 @@ def lobster_read(mh, filename, level, items, source_info=None): if all(filter_conditions): if item.tag.key() in items: mh.error(item.location, - "duplicate definition of %s, " - "previously defined at %s" % - (item.tag.key(), - items[item.tag.key()].location.to_string())) + "duplicate definition of %s, " + "previously defined at %s" % + (item.tag.key(), + items[item.tag.key()].location.to_string())) items[item.tag.key()] = item diff --git a/lobster/tools/core/html_report.py b/lobster/tools/core/html_report.py index 5473741a..a51e564c 100755 --- a/lobster/tools/core/html_report.py +++ b/lobster/tools/core/html_report.py @@ -258,7 +258,7 @@ def write_item_box_end(doc): doc.add_line('') -def write_html(fd, report, dot): +def write_html(fd, report, dot, high_contrast): assert isinstance(report, Report) doc = htmldoc.Document( @@ -286,13 +286,13 @@ def write_html(fd, report, dot): "padding-left" : "0.2em", } doc.style[".item-ok"] = { - "background-color" : "#efe", + "background-color" : "#b2e1b2" if high_contrast else "#efe", } doc.style[".item-partial"] = { "background-color" : "#ffe", } doc.style[".item-missing"] = { - "background-color" : "#fee", + "background-color" : "#ffb2ff" if high_contrast else "#fee", } doc.style[".item-justified"] = { "background-color" : "#eee", @@ -465,6 +465,9 @@ def main(): help="path to dot utility (https://graphviz.org), \ by default expected in PATH", default=None) + ap.add_argument("--high-contrast", + action="store_true", + help="Uses a color palette with a higher contrast.") options = ap.parse_args() if not os.path.isfile(options.lobster_report): @@ -479,7 +482,8 @@ def main(): with open(options.out, "w", encoding="UTF-8") as fd: write_html(fd = fd, report = report, - dot = options.dot) + dot = options.dot, + high_contrast = options.high_contrast) print("LOBSTER HTML report written to %s" % options.out) From c59ee9140e916f9999e5b86b6b3cebf11e21c089 Mon Sep 17 00:00:00 2001 From: akashsurwase1 <161583198+akashsurwase1@users.noreply.github.com> Date: Tue, 17 Sep 2024 20:25:28 +0530 Subject: [PATCH 4/8] remove line number from tag and added counter logic for each function (#67) The identifier uses counter if there exist multiple functions with the same name. Issue #58 --------- Co-authored-by: Kedar Navare Co-authored-by: Philipp Wullstein-Kammler <111539239+phiwuu@users.noreply.github.com> --- CHANGELOG.md | 4 ++ lobster/tools/python/python.py | 35 +++++++++++++++++- .../multiple_identical_function_names.output | Bin 0 -> 6174 bytes .../multiple_identical_function_names.py | 28 ++++++++++++++ 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 test-system/lobster-python/multiple_identical_function_names.output create mode 100644 test-system/lobster-python/multiple_identical_function_names.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 4254c93a..b078200f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ### 0.9.18-dev +* The `lobster-python` tool adds the counter logic to the function + identifier. This improves the situations where different functions have + the same name. Line numbers are no longer used in the identifier. + * The `lobster-codebeamer` tool now supports `refs` as an upstream reference * The `lobster-online-report` tool now works with config files located in diff --git a/lobster/tools/python/python.py b/lobster/tools/python/python.py index 1e545f4c..496bff68 100755 --- a/lobster/tools/python/python.py +++ b/lobster/tools/python/python.py @@ -22,6 +22,7 @@ import os.path import multiprocessing import functools +import re from libcst.metadata import PositionProvider import libcst as cst @@ -32,6 +33,28 @@ LOBSTER_TRACE_PREFIX = "# lobster-trace: " LOBSTER_JUST_PREFIX = "# lobster-exclude: " +func_name = [] + + +def count_occurrence_of_last_function_from_function_name_list(function_names): + """ + Function returns a function name + (last function from the list of function names) + and its occurrence from the given list of function names + Example: function_names = ['hello.add:2', 'hello.sub:5', 'hello.add:8'] + returns : hello.add-2 + """ + function_and_file_name = re.split(r"[.:]", function_names[-1]) + filename = function_and_file_name[0] + last_function = function_and_file_name[1] + count = 0 + for element in range(0, len(function_names) - 1): + if re.split(r"[.:]", function_names[element])[1] == last_function: + count += 1 + function_name = (filename + "." + last_function + + ("-" + str(count) if count > 0 else '')) + + return function_name def parse_value(val): @@ -197,13 +220,21 @@ def to_lobster(self, schema, items): assert schema is Implementation or schema is Activity assert isinstance(items, list) + func_name.append(self.fqn()) + tagname = count_occurrence_of_last_function_from_function_name_list( + func_name + ) + pattern = r"[-]" + val = re.split(pattern, tagname) + name_value = val[0] + if schema is Implementation: l_item = Implementation(tag = Tracing_Tag("python", - self.fqn()), + tagname), location = self.location, language = "Python", kind = self.kind, - name = self.fqn()) + name = name_value) else: if not self.name.startswith("test"): return diff --git a/test-system/lobster-python/multiple_identical_function_names.output b/test-system/lobster-python/multiple_identical_function_names.output new file mode 100644 index 0000000000000000000000000000000000000000..a09f9df2307cbcb8f86c4e4c3e10b692475e0877 GIT binary patch literal 6174 zcmeHL+fKqj5S?ce|H16Dg#hsqKfq_-iD|H{2rdO%&=A9~t7mpw=w)%OmspZb)5~^e zXV2U^(|Lb;rDHmx6C8p<8qpG`peu}r+ZmqS(eX&rGwnE|7PO!>RzJ|3V$9EIMH1r) z-b;$e$5V)VtlkA!De>+eR51nW9k26oj<7bOlse!YVaBHf_a{(J)DzD#mlQjnmN05m z5(t<-@69~5GZ(GPRnk5ekiqD-=gEKkzKS=`ODWNvM&wZ-QLLlp5s-_R$hPHdk9znH zy1Z@DfsWd8-tN)Bpsn`Cx6S@0xkXm-xy;@E_zqE3rmChNp)PT?`M!UbCKP^8CNO{khy$t9jISwR(dd zTc6GkD!y&@ck#{NW_>j8vgLjCVuw(u&SZ@4SAq`P61~JE>k5iWzt}JJi;I>JsJ{dB p*}2P{_v)*wJyhv4aPY7P?-YQ#%;Q;MNI|#jkq=a#aHFn_{sTX=e!&0$ literal 0 HcmV?d00001 diff --git a/test-system/lobster-python/multiple_identical_function_names.py b/test-system/lobster-python/multiple_identical_function_names.py new file mode 100644 index 00000000..7e6e9e7b --- /dev/null +++ b/test-system/lobster-python/multiple_identical_function_names.py @@ -0,0 +1,28 @@ +flag = False +requirements_global = None + +if flag == True: + def get_requirements(requirements): + return requirements +else: + def set_requirements(requirements): + requirements_global = requirements + return requirements_global + + +def get_requirements(requirements): + return requirements + + +def display_requirements(): + print(get_requirements()) + + +def set_requirements(requirements): + requirements_global = requirements + return requirements_global + + +def get_requirements(requirements): + return requirements + From fb705f90c61faeb15d08099bf585102c826c2c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Kl=C3=B6ffel?= <145490354+christophkloeffel@users.noreply.github.com> Date: Mon, 23 Sep 2024 08:31:00 +0200 Subject: [PATCH 5/8] adds python 3.12 to the CI testsuite (#72) --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc829c3f..c9b202e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-13, macos-14] - py-version: ["3.8", "3.9", "3.10", "3.11"] + py-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] include: - os: macos-13 brew: "/usr/local" @@ -49,8 +49,7 @@ jobs: run: | brew install python@${{ matrix.py-version }} echo "${{ matrix.brew }}/opt/python@${{ matrix.py-version }}/libexec/bin" >> $GITHUB_PATH - curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py - python${{ matrix.py-version }} get-pip.py + python${{ matrix.py-version }} -m ensurepip - name: Install dependencies run: | python -m pip install --upgrade pip From 77e74a1f9aa244b5922ec22782f1f6f019502963 Mon Sep 17 00:00:00 2001 From: Diego Fernandez <110383200+DiFerMa@users.noreply.github.com> Date: Mon, 23 Sep 2024 08:40:36 +0200 Subject: [PATCH 6/8] Feature/implement coverage (#78) * implement coverage for lobster * Include coverage report and test outputs to lobster * Add ci-tests to workflow --- .github/workflows/ci.yml | 7 +++++++ Makefile | 14 +++++++++++++- coverage.cfg | 16 ++++++++++++++++ requirements_dev.txt | 1 + test-system/lobster-json/Makefile | 4 +++- test-system/lobster-python/Makefile | 4 +++- test-system/lobster-python/basic.output | 8 ++++---- .../multiple_identical_function_names.output | Bin 6174 -> 2904 bytes .../multiple_identical_function_names.py | 2 ++ test-system/lobster-python/pytest_mark.output | 8 ++++---- util/check_local_modifications.sh | 11 +++++++++++ 11 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 coverage.cfg create mode 100755 util/check_local_modifications.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9b202e7..9777ef0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,3 +65,10 @@ jobs: - name: Executing system tests run: | make system-tests + - name: Coverage analysis + run: | + make coverage + - name: Check output files + if: always() + run: | + util/check_local_modifications.sh diff --git a/Makefile b/Makefile index fa4eccc7..26fdd4bd 100644 --- a/Makefile +++ b/Makefile @@ -45,11 +45,15 @@ integration-tests: packages (cd integration-tests/projects/filter; make) system-tests: + mkdir -p docs make -B -C test-system/lobster-json make -B -C test-system/lobster-python unit-tests: - python3 -m unittest discover -s test-unit -v + coverage run -p \ + --branch --rcfile=coverage.cfg \ + --data-file .coverage \ + -m unittest discover -s test-unit -v test: integration-tests system-tests unit-tests @@ -74,3 +78,11 @@ full-release: make github-release make bump git push + +coverage: + coverage combine -q + coverage html --rcfile=coverage.cfg + coverage report --rcfile=coverage.cfg --fail-under=57 + +test-ci: system-tests unit-tests coverage + util/check_local_modifications.sh diff --git a/coverage.cfg b/coverage.cfg new file mode 100644 index 00000000..85c4728c --- /dev/null +++ b/coverage.cfg @@ -0,0 +1,16 @@ +[report] +exclude_lines = + pragma: no cover + ice_loc + @abstractmethod + if DEBUG_ + assert False + def __repr__(self) + def sanity_test() + if __name__ == "__main__" + +[run] +omit = + /usr/* + */site-packages/* + test-unit/* diff --git a/requirements_dev.txt b/requirements_dev.txt index 546c61b7..700430d4 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,3 +1,4 @@ -r requirements.txt pycodestyle==2.12.0 pylint==3.2.4 +coverage>=7.2 diff --git a/test-system/lobster-json/Makefile b/test-system/lobster-json/Makefile index 83aff3fa..3f3f880a 100644 --- a/test-system/lobster-json/Makefile +++ b/test-system/lobster-json/Makefile @@ -7,7 +7,9 @@ all: $(TARGETS) %.output: %.input @tail +2 $< > $*.json @touch $*.lobster - -$(TOOL) $(shell head -1 $< | tail --bytes=+3) --out=$*.lobster --single > $@ 2>&1 + -@coverage run -p --rcfile=../../coverage.cfg --branch \ + --data-file ../../.coverage \ + $(TOOL) $(shell head -1 $< | tail --bytes=+3) --out=$*.lobster --single > $@ 2>&1 @echo "==========" >> $@ @cat $*.lobster >> $@ @rm $*.json $*.lobster diff --git a/test-system/lobster-python/Makefile b/test-system/lobster-python/Makefile index 43f9e485..1188b10d 100644 --- a/test-system/lobster-python/Makefile +++ b/test-system/lobster-python/Makefile @@ -6,7 +6,9 @@ all: $(TARGETS) %.output: %.py @touch $*.lobster - -$(TOOL) $(shell head -1 $< | tail --bytes=+2) $< --out=$*.lobster --single > $@ 2>&1 + -@coverage run -p --rcfile=../../coverage.cfg --branch \ + --data-file ../../.coverage \ + $(TOOL) $(shell head -1 $< | tail --bytes=+2) $< --out=$*.lobster --single > $@ 2>&1 @echo "==========" >> $@ @cat $*.lobster >> $@ @rm $*.lobster diff --git a/test-system/lobster-python/basic.output b/test-system/lobster-python/basic.output index e622e4c5..e7751c8a 100644 --- a/test-system/lobster-python/basic.output +++ b/test-system/lobster-python/basic.output @@ -21,14 +21,14 @@ Written output for 3 items to basic.lobster "kind": "Function" }, { - "tag": "python basic.Example.helper_function", + "tag": "python basic.Example", "location": { "kind": "file", "file": "basic.py", "line": 13, "column": null }, - "name": "basic.Example.helper_function", + "name": "basic.Example", "messages": [], "just_up": [], "just_down": [], @@ -40,14 +40,14 @@ Written output for 3 items to basic.lobster "kind": "Method" }, { - "tag": "python basic.Example.nor", + "tag": "python basic.Example-1", "location": { "kind": "file", "file": "basic.py", "line": 17, "column": null }, - "name": "basic.Example.nor", + "name": "basic.Example", "messages": [], "just_up": [], "just_down": [], diff --git a/test-system/lobster-python/multiple_identical_function_names.output b/test-system/lobster-python/multiple_identical_function_names.output index a09f9df2307cbcb8f86c4e4c3e10b692475e0877..31c4f3979826f2977b5f4165bc9ac97eabc4c189 100644 GIT binary patch literal 2904 zcmds3O;5ux488YPL^)GLH}NTP<;;!4gsRYbT_8 z^GmFEXC)$NW;|9N+1yxm#w0@N7#dc3g|bqR${aMxOsI73b%xUDRErYau`&-1!A95Z z6TL-@@m!$bS8PV_jD<*eIEsRTyjtSI=pUdLfT@LNFD;Z*fa6CEk}{bHWe{A0PWVq! z=OMvdDromoy#A*6Za&rW<9|wOAiVP?EkR{Q`7)%{Ua3trt7e^tri21^C)!Sp+Ui6B zj&Nr8E%KvxnEL9AU~XPRJ^j4}Nh8$f1toOh37ew)wicmf+xG5eBQUSYZKyRp{Gp01Z~4vB4Q_JZ-wR isdeq#WeX^Sqit4WSynMxk*$p;e*x>(esmhGqUarjpH+eY literal 6174 zcmeHL+fKqj5S?ce|H16Dg#hsqKfq_-iD|H{2rdO%&=A9~t7mpw=w)%OmspZb)5~^e zXV2U^(|Lb;rDHmx6C8p<8qpG`peu}r+ZmqS(eX&rGwnE|7PO!>RzJ|3V$9EIMH1r) z-b;$e$5V)VtlkA!De>+eR51nW9k26oj<7bOlse!YVaBHf_a{(J)DzD#mlQjnmN05m z5(t<-@69~5GZ(GPRnk5ekiqD-=gEKkzKS=`ODWNvM&wZ-QLLlp5s-_R$hPHdk9znH zy1Z@DfsWd8-tN)Bpsn`Cx6S@0xkXm-xy;@E_zqE3rmChNp)PT?`M!UbCKP^8CNO{khy$t9jISwR(dd zTc6GkD!y&@ck#{NW_>j8vgLjCVuw(u&SZ@4SAq`P61~JE>k5iWzt}JJi;I>JsJ{dB p*}2P{_v)*wJyhv4aPY7P?-YQ#%;Q;MNI|#jkq=a#aHFn_{sTX=e!&0$ diff --git a/test-system/lobster-python/multiple_identical_function_names.py b/test-system/lobster-python/multiple_identical_function_names.py index 7e6e9e7b..4eb04247 100644 --- a/test-system/lobster-python/multiple_identical_function_names.py +++ b/test-system/lobster-python/multiple_identical_function_names.py @@ -1,3 +1,5 @@ +# + flag = False requirements_global = None diff --git a/test-system/lobster-python/pytest_mark.output b/test-system/lobster-python/pytest_mark.output index f0fd12cf..df3ff3df 100644 --- a/test-system/lobster-python/pytest_mark.output +++ b/test-system/lobster-python/pytest_mark.output @@ -3,14 +3,14 @@ Written output for 2 items to pytest_mark.lobster { "data": [ { - "tag": "pyunit pytest_mark.TestFrameServerProcessesStart.test_1", + "tag": "pyunit pytest_mark.TestFrameServerProcessesStart.test_1:21", "location": { "kind": "file", "file": "pytest_mark.py", "line": 21, "column": null }, - "name": "pytest_mark.TestFrameServerProcessesStart.test_1", + "name": "pytest_mark.TestFrameServerProcessesStart.test_1:21", "messages": [], "just_up": [], "just_down": [], @@ -23,14 +23,14 @@ Written output for 2 items to pytest_mark.lobster "status": null }, { - "tag": "pyunit pytest_mark.TestFrameServerProcessesStart.test_2", + "tag": "pyunit pytest_mark.TestFrameServerProcessesStart.test_2:24", "location": { "kind": "file", "file": "pytest_mark.py", "line": 24, "column": null }, - "name": "pytest_mark.TestFrameServerProcessesStart.test_2", + "name": "pytest_mark.TestFrameServerProcessesStart.test_2:24", "messages": [], "just_up": [], "just_down": [], diff --git a/util/check_local_modifications.sh b/util/check_local_modifications.sh new file mode 100755 index 00000000..e227600a --- /dev/null +++ b/util/check_local_modifications.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +if [[ $(git status -s) ]]; then + echo "Local modifications found:" + git -P diff + echo "Summary:" + git status -s + exit 1 +else + exit 0 +fi From 7017e874171f7c671fad03b9e7918267885abbdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Kl=C3=B6ffel?= <145490354+christophkloeffel@users.noreply.github.com> Date: Mon, 30 Sep 2024 09:45:48 +0200 Subject: [PATCH 7/8] fixes externally-managed-environment error (#81) --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9777ef0d..71714f66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,8 +18,8 @@ jobs: - uses: actions/checkout@v4 - name: Install dependencies run: | - python3 -m pip install --upgrade pip - python3 -m pip install -r requirements_dev.txt + python3 -m pip install --upgrade pip --break-system-packages + python3 -m pip install -r requirements_dev.txt --break-system-packages make lobster/html/assets.py - name: Executing linter run: | From 982b9baea4a79e114ec1ecc7a25a9563d3662386 Mon Sep 17 00:00:00 2001 From: Diego Fernandez <110383200+DiFerMa@users.noreply.github.com> Date: Mon, 30 Sep 2024 10:28:57 +0200 Subject: [PATCH 8/8] Add static pages to Lobster (#82) Make static pages into LOBSTER --- .github/workflows/docs.yml | 60 ++++++++++++++++++ Makefile | 4 ++ README.md | 8 ++- {docs => documentation}/advanced.dot | 0 {docs => documentation}/advanced.svg | 0 {docs => documentation}/architecture.dot | 0 {docs => documentation}/architecture.png | Bin {docs => documentation}/cb_lobster_query.png | Bin {docs => documentation}/config_files.md | 0 {docs => documentation}/example_report.html | 0 .../manual-lobster_codebeamer.md | 0 .../manual-lobster_gtest.md | 0 {docs => documentation}/schemas.md | 0 {docs => documentation}/simple.dot | 0 {docs => documentation}/simple.svg | 0 {docs => documentation}/user-manual.md | 0 integration-tests/projects/basic/Makefile | 2 +- packages/lobster-tool-json/README.md | 2 +- 18 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/docs.yml rename {docs => documentation}/advanced.dot (100%) rename {docs => documentation}/advanced.svg (100%) rename {docs => documentation}/architecture.dot (100%) rename {docs => documentation}/architecture.png (100%) rename {docs => documentation}/cb_lobster_query.png (100%) rename {docs => documentation}/config_files.md (100%) rename {docs => documentation}/example_report.html (100%) rename {docs => documentation}/manual-lobster_codebeamer.md (100%) rename {docs => documentation}/manual-lobster_gtest.md (100%) rename {docs => documentation}/schemas.md (100%) rename {docs => documentation}/simple.dot (100%) rename {docs => documentation}/simple.svg (100%) rename {docs => documentation}/user-manual.md (100%) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..3fc2a27b --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,60 @@ +name: Deploy static content to Pages + +on: + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy: + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: "3.9" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements_dev.txt + - name: Generate docs + run: | + make docs + env: + PYTHONPATH: "." + - name: Building code coverage report + run: | + make system-tests unit-tests + make coverage + mv htmlcov docs + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: 'docs' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/Makefile b/Makefile index 26fdd4bd..08bf1534 100644 --- a/Makefile +++ b/Makefile @@ -86,3 +86,7 @@ coverage: test-ci: system-tests unit-tests coverage util/check_local_modifications.sh + +docs: + rm -rf docs + mkdir docs diff --git a/README.md b/README.md index bb39cad8..905fe9cc 100644 --- a/README.md +++ b/README.md @@ -47,10 +47,10 @@ The following verification and miscellaneous frameworks are supported: ## Documentation -* Writing [configuration files](docs/config_files.md) for LOBSTER. +* Writing [configuration files](documentation/config_files.md) for LOBSTER. * It is easy to expand the languages and activities supported by LOBSTER by adding new tracing tools, as long as they create data in - the [common interchange format](docs/schemas.md) for LOBSTER. + the [common interchange format](documentation/schemas.md) for LOBSTER. (More to come...) @@ -67,6 +67,10 @@ The individual packages that `bmw-lobster` depends on are: * `bmw-lobster-tool-json` (for activities in JSON) * `miss_hit` (for MATLAB/Octave code or Simulink models) +### For LOBSTER developers + +* [Code Coverage Report](https://bmw-software-engineering.github.io/lobster/htmlcov/index.html) + ## Planned inputs The following inputs are planned but not implemeted yet: diff --git a/docs/advanced.dot b/documentation/advanced.dot similarity index 100% rename from docs/advanced.dot rename to documentation/advanced.dot diff --git a/docs/advanced.svg b/documentation/advanced.svg similarity index 100% rename from docs/advanced.svg rename to documentation/advanced.svg diff --git a/docs/architecture.dot b/documentation/architecture.dot similarity index 100% rename from docs/architecture.dot rename to documentation/architecture.dot diff --git a/docs/architecture.png b/documentation/architecture.png similarity index 100% rename from docs/architecture.png rename to documentation/architecture.png diff --git a/docs/cb_lobster_query.png b/documentation/cb_lobster_query.png similarity index 100% rename from docs/cb_lobster_query.png rename to documentation/cb_lobster_query.png diff --git a/docs/config_files.md b/documentation/config_files.md similarity index 100% rename from docs/config_files.md rename to documentation/config_files.md diff --git a/docs/example_report.html b/documentation/example_report.html similarity index 100% rename from docs/example_report.html rename to documentation/example_report.html diff --git a/docs/manual-lobster_codebeamer.md b/documentation/manual-lobster_codebeamer.md similarity index 100% rename from docs/manual-lobster_codebeamer.md rename to documentation/manual-lobster_codebeamer.md diff --git a/docs/manual-lobster_gtest.md b/documentation/manual-lobster_gtest.md similarity index 100% rename from docs/manual-lobster_gtest.md rename to documentation/manual-lobster_gtest.md diff --git a/docs/schemas.md b/documentation/schemas.md similarity index 100% rename from docs/schemas.md rename to documentation/schemas.md diff --git a/docs/simple.dot b/documentation/simple.dot similarity index 100% rename from docs/simple.dot rename to documentation/simple.dot diff --git a/docs/simple.svg b/documentation/simple.svg similarity index 100% rename from docs/simple.svg rename to documentation/simple.svg diff --git a/docs/user-manual.md b/documentation/user-manual.md similarity index 100% rename from docs/user-manual.md rename to documentation/user-manual.md diff --git a/integration-tests/projects/basic/Makefile b/integration-tests/projects/basic/Makefile index 243c1781..908cfb6f 100644 --- a/integration-tests/projects/basic/Makefile +++ b/integration-tests/projects/basic/Makefile @@ -14,7 +14,7 @@ html_report.html: cppcode.lobster gtests.lobster mcode.lobster system-requiremen @lobster-online-report @cp report.lobster report.reference_output @lobster-html-report - @cp lobster_report.html ../../../docs/example_report.html + @cp lobster_report.html ../../../documentation/example_report.html @lobster-ci-report | tee ci_report.reference_output cppcode.lobster: foo.h foo.cpp diff --git a/packages/lobster-tool-json/README.md b/packages/lobster-tool-json/README.md index a1594ef1..b7414fd0 100644 --- a/packages/lobster-tool-json/README.md +++ b/packages/lobster-tool-json/README.md @@ -106,7 +106,7 @@ Then you can use `--test-list=vectors` to identify the correct list. Note: This tool is pretty limited. For the obvious cases it works pretty well, but if you have a more complex test definition in JSON then you will need to write your own adaptor [using the documented -schema](https://github.com/bmw-software-engineering/lobster/blob/main/docs/schemas.md). +schema](https://github.com/bmw-software-engineering/lobster/blob/main/documentation/schemas.md). ## Copyright & License information