From 2c1646ddd25e2743227d87efbab466f699812b30 Mon Sep 17 00:00:00 2001 From: MoromugHSE Date: Mon, 1 Apr 2024 06:56:05 +0300 Subject: [PATCH 1/5] Added description to repo information gained on discovery. --- steps/discover-repos.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/steps/discover-repos.rb b/steps/discover-repos.rb index 74c14742..beda335c 100755 --- a/steps/discover-repos.rb +++ b/steps/discover-repos.rb @@ -87,7 +87,8 @@ forks: i[:forks_count], created_at: i[:created_at].iso8601, size: i[:size], - open_issues_count: i[:open_issues_count] + open_issues_count: i[:open_issues_count], + description: i[:description] } puts "Found #{i[:full_name].inspect} GitHub repo ##{found.count} \ (#{i[:forks_count]} forks, #{i[:stargazers_count]} stars)" From 1c7cfa4bb2ecb8c71f5a45415b8ef903558ee082 Mon Sep 17 00:00:00 2001 From: MoromugHSE Date: Mon, 1 Apr 2024 07:05:03 +0300 Subject: [PATCH 2/5] Updated description collection with enclosing the field in quotes to sustain the csv file structure. --- steps/discover-repos.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/steps/discover-repos.rb b/steps/discover-repos.rb index beda335c..83948135 100755 --- a/steps/discover-repos.rb +++ b/steps/discover-repos.rb @@ -88,7 +88,7 @@ created_at: i[:created_at].iso8601, size: i[:size], open_issues_count: i[:open_issues_count], - description: i[:description] + description: "\"".concat(i[:description], "\"") } puts "Found #{i[:full_name].inspect} GitHub repo ##{found.count} \ (#{i[:forks_count]} forks, #{i[:stargazers_count]} stars)" From ef9a8f3558432a60f4a0bcd9a732a427372b36c0 Mon Sep 17 00:00:00 2001 From: MoromugHSE Date: Mon, 1 Apr 2024 10:29:08 +0300 Subject: [PATCH 3/5] Simplified the repo description collection; updated the repo discovery test to count the number of columns in the resulting csv file. --- steps/discover-repos.rb | 2 +- tests/steps/test-discover-repos.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/steps/discover-repos.rb b/steps/discover-repos.rb index 83948135..beda335c 100755 --- a/steps/discover-repos.rb +++ b/steps/discover-repos.rb @@ -88,7 +88,7 @@ created_at: i[:created_at].iso8601, size: i[:size], open_issues_count: i[:open_issues_count], - description: "\"".concat(i[:description], "\"") + description: i[:description] } puts "Found #{i[:full_name].inspect} GitHub repo ##{found.count} \ (#{i[:forks_count]} forks, #{i[:stargazers_count]} stars)" diff --git a/tests/steps/test-discover-repos.sh b/tests/steps/test-discover-repos.sh index 8cd63bb0..c26850fd 100755 --- a/tests/steps/test-discover-repos.sh +++ b/tests/steps/test-discover-repos.sh @@ -37,6 +37,7 @@ tex=${TARGET}/foo.tex test -e "${csv}" test -s "${tex}" test "$(wc -l < "${csv}" | xargs)" = '4' + test "$(head -1 "${csv}" | tr "," "\n" | wc -l | xargs)" = '8' } > "${stdout}" 2>&1 echo "👍🏻 Small repositories discovery test is succeed" @@ -49,5 +50,6 @@ echo "👍🏻 Small repositories discovery test is succeed" test -e "${csv}" test -s "${tex}" test "$(wc -l < "${csv}" | xargs)" = '36' + test "$(head -1 "${csv}" | tr "," "\n" | wc -l | xargs)" = '8' } > "${stdout}" 2>&1 echo "👍🏻 Medium repositories discovery test is succeed" From 0921b389ba643e429af68c05b760fd4b12983079 Mon Sep 17 00:00:00 2001 From: MoromugHSE Date: Mon, 1 Apr 2024 20:37:24 +0300 Subject: [PATCH 4/5] Now I'm 100% sure. This build even works in docker. I can't imagine it failing. I cannot. --- tests/steps/test-discover-repos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/steps/test-discover-repos.sh b/tests/steps/test-discover-repos.sh index c26850fd..a7338307 100755 --- a/tests/steps/test-discover-repos.sh +++ b/tests/steps/test-discover-repos.sh @@ -34,8 +34,8 @@ tex=${TARGET}/foo.tex echo "${msg}" echo "${msg}" | grep "Found 1 repositories in page #0" echo "${msg}" | grep "Found 3 total repositories in GitHub" - test -e "${csv}" test -s "${tex}" + test -e "${csv}" test "$(wc -l < "${csv}" | xargs)" = '4' test "$(head -1 "${csv}" | tr "," "\n" | wc -l | xargs)" = '8' } > "${stdout}" 2>&1 @@ -47,8 +47,8 @@ echo "👍🏻 Small repositories discovery test is succeed" echo "${msg}" echo "${msg}" | grep "Found 60 total repositories in GitHub" echo "${msg}" | grep "We will use only the first 35 repositories" - test -e "${csv}" test -s "${tex}" + test -e "${csv}" test "$(wc -l < "${csv}" | xargs)" = '36' test "$(head -1 "${csv}" | tr "," "\n" | wc -l | xargs)" = '8' } > "${stdout}" 2>&1 From 9b346986f1f1f48dc0eae833656c461d20785b07 Mon Sep 17 00:00:00 2001 From: MoromugHSE Date: Mon, 1 Apr 2024 21:27:42 +0300 Subject: [PATCH 5/5] I've removed redundant target from non-docker runs. Should work? --- tests/steps/test-discover-repos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/steps/test-discover-repos.sh b/tests/steps/test-discover-repos.sh index a7338307..c26850fd 100755 --- a/tests/steps/test-discover-repos.sh +++ b/tests/steps/test-discover-repos.sh @@ -34,8 +34,8 @@ tex=${TARGET}/foo.tex echo "${msg}" echo "${msg}" | grep "Found 1 repositories in page #0" echo "${msg}" | grep "Found 3 total repositories in GitHub" - test -s "${tex}" test -e "${csv}" + test -s "${tex}" test "$(wc -l < "${csv}" | xargs)" = '4' test "$(head -1 "${csv}" | tr "," "\n" | wc -l | xargs)" = '8' } > "${stdout}" 2>&1 @@ -47,8 +47,8 @@ echo "👍🏻 Small repositories discovery test is succeed" echo "${msg}" echo "${msg}" | grep "Found 60 total repositories in GitHub" echo "${msg}" | grep "We will use only the first 35 repositories" - test -s "${tex}" test -e "${csv}" + test -s "${tex}" test "$(wc -l < "${csv}" | xargs)" = '36' test "$(head -1 "${csv}" | tr "," "\n" | wc -l | xargs)" = '8' } > "${stdout}" 2>&1