Loading .gitlab-ci.yml +1 −1 Original line number Original line Diff line number Diff line test: test: script: script: docker run -v$(pwd):/work:ro etsiforge/r2d "/bin/sh" -c "cd /work/robot2doc && python3 -m pytest" docker run -v$(pwd):/work:rw --user $(id -u):$(id -g) etsiforge/r2d "/bin/sh" -c "cd /work/robot2doc && python3 -m pytest" No newline at end of file No newline at end of file robot2doc/create_sols.py +4 −2 Original line number Original line Diff line number Diff line Loading @@ -196,6 +196,7 @@ def get_git_reference(folder): return (None, None, branch) return (None, None, branch) if __name__ == "__main__": if __name__ == "__main__": if len(sys.argv) < 2: if len(sys.argv) < 2: Loading Loading @@ -229,6 +230,7 @@ if __name__ == "__main__": else: else: print("Could not determine branch") print("Could not determine branch") for solspec in sol_specs: for solspec in sol_specs: spec_index = load_spec_index(ROOT, solspec) spec_index = load_spec_index(ROOT, solspec) create_test_for_sol(solspec, spec_index, ROOT, COMMIT_ID, OUTDIR) create_test_for_sol(solspec, spec_index, ROOT, COMMIT_ID, OUTDIR) Loading robot2doc/docker/Dockerfile 0 → 100644 +23 −0 Original line number Original line Diff line number Diff line FROM ubuntu:20.04 MAINTAINER ETSI CTI LABEL description="ETSI CTI robot2doc software tests image" RUN DEBIAN_FRONTEND=noninteractive apt update \ && apt install python3 git -y \ && apt install python3-pip -y \ && DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y \ && DEBIAN_FRONTEND=noninteractive apt-get autoclean \ && rm -rf /var/lib/apt/lists/* RUN useradd --create-home --shell /bin/bash --user-group gitlab-runner --groups sudo \ && echo "gitlab-runner:gitlab-runner" | chpasswd \ && adduser gitlab-runner sudo \ && echo "gitlab-runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers #To avoid to use the cache when new commits are available ADD "https://forge.etsi.org/rep/api/v4/projects/224/repository/branches/master" /tmp/devalidateCache RUN DEBIAN_FRONTED=noninteractive \ pip3 install pytest robotframework python-docx \ No newline at end of file robot2doc/test_create_sols.py +11 −1 Original line number Original line Diff line number Diff line Loading @@ -29,8 +29,18 @@ def test_parse_commit_from_log(): def test_get_git_reference(): def test_get_git_reference(): comm, reftype = crs.get_git_reference("..") comm, reftype, branch = crs.get_git_reference('..') assert comm is not None assert comm is not None assert isinstance(comm, str) assert isinstance(comm, str) def test_parse_branch_from_log(): '''Test usage of parse_branch_from_log''' with_branch = "231f303 (HEAD, tag: 2.7.1.0.0.2, origin/2.7.1-dev) updated indexes" with_master = "023ca44 (origin/master) Merge branch '2.7.1-dev-SOL002-branch' into '2.7.1-dev'" without_branch = "023ca44 (noBranch) Merge branch '2.7.1-dev-SOL002-branch' into '2.7.1-dev'" assert crs.parse_branch_from_log(with_branch) == "2.7.1-dev" assert crs.parse_branch_from_log(with_master) == "master" assert crs.parse_branch_from_log(without_branch) is None Loading
.gitlab-ci.yml +1 −1 Original line number Original line Diff line number Diff line test: test: script: script: docker run -v$(pwd):/work:ro etsiforge/r2d "/bin/sh" -c "cd /work/robot2doc && python3 -m pytest" docker run -v$(pwd):/work:rw --user $(id -u):$(id -g) etsiforge/r2d "/bin/sh" -c "cd /work/robot2doc && python3 -m pytest" No newline at end of file No newline at end of file
robot2doc/create_sols.py +4 −2 Original line number Original line Diff line number Diff line Loading @@ -196,6 +196,7 @@ def get_git_reference(folder): return (None, None, branch) return (None, None, branch) if __name__ == "__main__": if __name__ == "__main__": if len(sys.argv) < 2: if len(sys.argv) < 2: Loading Loading @@ -229,6 +230,7 @@ if __name__ == "__main__": else: else: print("Could not determine branch") print("Could not determine branch") for solspec in sol_specs: for solspec in sol_specs: spec_index = load_spec_index(ROOT, solspec) spec_index = load_spec_index(ROOT, solspec) create_test_for_sol(solspec, spec_index, ROOT, COMMIT_ID, OUTDIR) create_test_for_sol(solspec, spec_index, ROOT, COMMIT_ID, OUTDIR) Loading
robot2doc/docker/Dockerfile 0 → 100644 +23 −0 Original line number Original line Diff line number Diff line FROM ubuntu:20.04 MAINTAINER ETSI CTI LABEL description="ETSI CTI robot2doc software tests image" RUN DEBIAN_FRONTEND=noninteractive apt update \ && apt install python3 git -y \ && apt install python3-pip -y \ && DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y \ && DEBIAN_FRONTEND=noninteractive apt-get autoclean \ && rm -rf /var/lib/apt/lists/* RUN useradd --create-home --shell /bin/bash --user-group gitlab-runner --groups sudo \ && echo "gitlab-runner:gitlab-runner" | chpasswd \ && adduser gitlab-runner sudo \ && echo "gitlab-runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers #To avoid to use the cache when new commits are available ADD "https://forge.etsi.org/rep/api/v4/projects/224/repository/branches/master" /tmp/devalidateCache RUN DEBIAN_FRONTED=noninteractive \ pip3 install pytest robotframework python-docx \ No newline at end of file
robot2doc/test_create_sols.py +11 −1 Original line number Original line Diff line number Diff line Loading @@ -29,8 +29,18 @@ def test_parse_commit_from_log(): def test_get_git_reference(): def test_get_git_reference(): comm, reftype = crs.get_git_reference("..") comm, reftype, branch = crs.get_git_reference('..') assert comm is not None assert comm is not None assert isinstance(comm, str) assert isinstance(comm, str) def test_parse_branch_from_log(): '''Test usage of parse_branch_from_log''' with_branch = "231f303 (HEAD, tag: 2.7.1.0.0.2, origin/2.7.1-dev) updated indexes" with_master = "023ca44 (origin/master) Merge branch '2.7.1-dev-SOL002-branch' into '2.7.1-dev'" without_branch = "023ca44 (noBranch) Merge branch '2.7.1-dev-SOL002-branch' into '2.7.1-dev'" assert crs.parse_branch_from_log(with_branch) == "2.7.1-dev" assert crs.parse_branch_from_log(with_master) == "master" assert crs.parse_branch_from_log(without_branch) is None