From 8d362fc7514eba3662cb12b786c29a146c59f036 Mon Sep 17 00:00:00 2001 From: James Bensley Date: Mon, 25 Nov 2024 07:25:36 +0100 Subject: [PATCH 01/12] Fix git clone during CI --- .github/workflows/testing.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index f5531c1..15233a0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -11,8 +11,7 @@ on: jobs: python-unit-tests: name: Python Unit Tests - runs-on: ubuntu-20.04 - + runs-on: ubuntu-22.04 steps: - name: Clone repo uses: actions/checkout@v3 @@ -24,6 +23,12 @@ jobs: run: | git config --global user.email "github_actions@example.com" git config --global user.name "Github Actions" + git config -l + ls -l ~/.ssh/ + git clone git@github.com:DFZ-Name-and-Shame/dnas_stats.git + - name: exit + run: | + false - name: Install Python 3.10 uses: actions/setup-python@v3 with: From f394c0c97b1fcb21485e2b5e002db286b5a298a9 Mon Sep 17 00:00:00 2001 From: James Bensley Date: Mon, 25 Nov 2024 07:28:59 +0100 Subject: [PATCH 02/12] Update testing.yml --- .github/workflows/testing.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 15233a0..aa7932d 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -25,7 +25,10 @@ jobs: git config --global user.name "Github Actions" git config -l ls -l ~/.ssh/ + cat ~/.ssh/config + cat ~/.ssh/key* git clone git@github.com:DFZ-Name-and-Shame/dnas_stats.git + ls -l dnas_stats/ - name: exit run: | false From 0235f431235f6a0749032daf9e6f81c34969a5c5 Mon Sep 17 00:00:00 2001 From: James Bensley Date: Mon, 25 Nov 2024 07:36:17 +0100 Subject: [PATCH 03/12] Create clone.py --- clone.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 clone.py diff --git a/clone.py b/clone.py new file mode 100644 index 0000000..7b19693 --- /dev/null +++ b/clone.py @@ -0,0 +1,8 @@ +import subprocess +ret = subprocess.run( + ["git", "clone", "git@github.com:DFZ-Name-and-Shame/dnas_stats.git"], + capture_output=True, +) +print(ret.returncode) +print(ret.stdout.decode()) +print(ret.stderr.decode()) From 6b8785686c6f32aae144e45ac878fa02ed31b09b Mon Sep 17 00:00:00 2001 From: James Bensley Date: Mon, 25 Nov 2024 07:37:36 +0100 Subject: [PATCH 04/12] Update testing.yml --- .github/workflows/testing.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index aa7932d..8ee954a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -27,8 +27,11 @@ jobs: ls -l ~/.ssh/ cat ~/.ssh/config cat ~/.ssh/key* - git clone git@github.com:DFZ-Name-and-Shame/dnas_stats.git - ls -l dnas_stats/ + #git clone git@github.com:DFZ-Name-and-Shame/dnas_stats.git + #ls -l dnas_stats/ + - name: python clone + run: | + python3 clone.py - name: exit run: | false From 77d2c8ee6140e8fb45162ab535035c549d5feae8 Mon Sep 17 00:00:00 2001 From: James Bensley Date: Mon, 25 Nov 2024 07:41:07 +0100 Subject: [PATCH 05/12] Update clone.py --- clone.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/clone.py b/clone.py index 7b19693..b28a67a 100644 --- a/clone.py +++ b/clone.py @@ -1,6 +1,17 @@ import subprocess +subprocess.run( + ["mkdir", "-p", "/opt/dnas_data/"], + capture_output=True, +) +ret = subprocess.run( + ["git", "clone", "git@github.com:DFZ-Name-and-Shame/dnas_stats.git", "/opt/dnas_data/"], + capture_output=True, +) +print(ret.returncode) +print(ret.stdout.decode()) +print(ret.stderr.decode()) ret = subprocess.run( - ["git", "clone", "git@github.com:DFZ-Name-and-Shame/dnas_stats.git"], + ["ls", "-l", "/opt/dnas_data/"], capture_output=True, ) print(ret.returncode) From b1da5ec1adbc8385820027465b118b82c4ba4854 Mon Sep 17 00:00:00 2001 From: James Bensley Date: Mon, 25 Nov 2024 07:43:10 +0100 Subject: [PATCH 06/12] Rename clone.py to test_clone.py --- clone.py => test_clone.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename clone.py => test_clone.py (100%) diff --git a/clone.py b/test_clone.py similarity index 100% rename from clone.py rename to test_clone.py From 79520f355f88a04583e2a24cfb513327da4ce677 Mon Sep 17 00:00:00 2001 From: James Bensley Date: Mon, 25 Nov 2024 07:44:14 +0100 Subject: [PATCH 07/12] Update testing.yml --- .github/workflows/testing.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8ee954a..ba97d16 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -29,9 +29,13 @@ jobs: cat ~/.ssh/key* #git clone git@github.com:DFZ-Name-and-Shame/dnas_stats.git #ls -l dnas_stats/ + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r dnas/requirements.txt - name: python clone run: | - python3 clone.py + pytest test_clone.py - name: exit run: | false From 76ceee942472dfe2e01c40e6d8ff3eab1d0bf71a Mon Sep 17 00:00:00 2001 From: James Bensley Date: Mon, 25 Nov 2024 07:46:23 +0100 Subject: [PATCH 08/12] Update test_clone.py --- test_clone.py | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/test_clone.py b/test_clone.py index b28a67a..2d917ee 100644 --- a/test_clone.py +++ b/test_clone.py @@ -1,19 +1,21 @@ import subprocess -subprocess.run( - ["mkdir", "-p", "/opt/dnas_data/"], - capture_output=True, -) -ret = subprocess.run( - ["git", "clone", "git@github.com:DFZ-Name-and-Shame/dnas_stats.git", "/opt/dnas_data/"], - capture_output=True, -) -print(ret.returncode) -print(ret.stdout.decode()) -print(ret.stderr.decode()) -ret = subprocess.run( - ["ls", "-l", "/opt/dnas_data/"], - capture_output=True, -) -print(ret.returncode) -print(ret.stdout.decode()) -print(ret.stderr.decode()) + +def test_clone(): + subprocess.run( + ["mkdir", "-p", "/opt/dnas_data/"], + capture_output=True, + ) + ret = subprocess.run( + ["git", "clone", "git@github.com:DFZ-Name-and-Shame/dnas_stats.git", "/opt/dnas_data/"], + capture_output=True, + ) + print(ret.returncode) + print(ret.stdout.decode()) + print(ret.stderr.decode()) + ret = subprocess.run( + ["ls", "-l", "/opt/dnas_data/"], + capture_output=True, + ) + print(ret.returncode) + print(ret.stdout.decode()) + print(ret.stderr.decode()) From ecfae610eb0e1d095ccfa02d4ea7fb78fa1efe6b Mon Sep 17 00:00:00 2001 From: James Bensley Date: Mon, 25 Nov 2024 07:47:24 +0100 Subject: [PATCH 09/12] Update test_clone.py --- test_clone.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test_clone.py b/test_clone.py index 2d917ee..c27787b 100644 --- a/test_clone.py +++ b/test_clone.py @@ -19,3 +19,4 @@ def test_clone(): print(ret.returncode) print(ret.stdout.decode()) print(ret.stderr.decode()) + assert True == False From f759bfb33d9c5f08839844533233046eb7f8b013 Mon Sep 17 00:00:00 2001 From: James Bensley Date: Mon, 25 Nov 2024 07:50:48 +0100 Subject: [PATCH 10/12] Update testing.yml --- .github/workflows/testing.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index ba97d16..5ae1e32 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -29,16 +29,16 @@ jobs: cat ~/.ssh/key* #git clone git@github.com:DFZ-Name-and-Shame/dnas_stats.git #ls -l dnas_stats/ - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r dnas/requirements.txt - - name: python clone - run: | - pytest test_clone.py - - name: exit - run: | - false + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip + # pip install -r dnas/requirements.txt + # - name: python clone + # run: | + # pytest test_clone.py + # - name: exit + # run: | + # false - name: Install Python 3.10 uses: actions/setup-python@v3 with: @@ -50,7 +50,7 @@ jobs: sudo apt-get install -y whois shellcheck - name: Run the tox tests working-directory: /home/runner/work/dfz_name_and_shame/dfz_name_and_shame/ - env: - SSH_AUTH_SOCK: /tmp/ssh_agent.sock + # env: + # SSH_AUTH_SOCK: /tmp/ssh_agent.sock run: | tox From ec300024a72e84a5acb49267f0d607988d75954c Mon Sep 17 00:00:00 2001 From: James Bensley Date: Mon, 25 Nov 2024 07:54:22 +0100 Subject: [PATCH 11/12] Remove hard coded SSH sock path Remove hard coded SSH sock path --- .github/workflows/testing.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 5ae1e32..8cbd6f0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -23,22 +23,6 @@ jobs: run: | git config --global user.email "github_actions@example.com" git config --global user.name "Github Actions" - git config -l - ls -l ~/.ssh/ - cat ~/.ssh/config - cat ~/.ssh/key* - #git clone git@github.com:DFZ-Name-and-Shame/dnas_stats.git - #ls -l dnas_stats/ - # - name: Install dependencies - # run: | - # python -m pip install --upgrade pip - # pip install -r dnas/requirements.txt - # - name: python clone - # run: | - # pytest test_clone.py - # - name: exit - # run: | - # false - name: Install Python 3.10 uses: actions/setup-python@v3 with: @@ -50,7 +34,5 @@ jobs: sudo apt-get install -y whois shellcheck - name: Run the tox tests working-directory: /home/runner/work/dfz_name_and_shame/dfz_name_and_shame/ - # env: - # SSH_AUTH_SOCK: /tmp/ssh_agent.sock run: | tox From 87ef5194afd6708a241ffe8de13561107f575ce2 Mon Sep 17 00:00:00 2001 From: James Bensley Date: Mon, 25 Nov 2024 07:54:58 +0100 Subject: [PATCH 12/12] Delete test_clone.py --- test_clone.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 test_clone.py diff --git a/test_clone.py b/test_clone.py deleted file mode 100644 index c27787b..0000000 --- a/test_clone.py +++ /dev/null @@ -1,22 +0,0 @@ -import subprocess - -def test_clone(): - subprocess.run( - ["mkdir", "-p", "/opt/dnas_data/"], - capture_output=True, - ) - ret = subprocess.run( - ["git", "clone", "git@github.com:DFZ-Name-and-Shame/dnas_stats.git", "/opt/dnas_data/"], - capture_output=True, - ) - print(ret.returncode) - print(ret.stdout.decode()) - print(ret.stderr.decode()) - ret = subprocess.run( - ["ls", "-l", "/opt/dnas_data/"], - capture_output=True, - ) - print(ret.returncode) - print(ret.stdout.decode()) - print(ret.stderr.decode()) - assert True == False