Skip to content

Commit

Permalink
Use $did as did --config in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixoid committed Oct 10, 2024
1 parent 010a0c5 commit 145861e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
20 changes: 11 additions & 9 deletions tests/github/issues.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1

did="did --config"

YEAR_2021="--since 2021-01-01 --until 2021-12-31"
YEAR_2022="--since 2022-01-01 --until 2022-12-31"
YEAR_2023="--since 2023-01-01 --until 2023-12-31"
Expand All @@ -10,39 +12,39 @@ rlJournalStart
# Issues Created

rlPhaseStartTest "Issues Created"
rlRun -s "did --config ./config-default.ini --gh-issues-created $YEAR_2022"
rlRun -s "$did ./config-default.ini --gh-issues-created $YEAR_2022"
rlAssertGrep "Issues created on gh: 31$" $rlRun_LOG
rlAssertGrep "teemtee/tmt#1737 - Introduce a new step for cleanup tasks" $rlRun_LOG
rlAssertGrep "teemtee/fmf#149 - Checkout of the default branch fails" $rlRun_LOG
rlAssertGrep "packit/packit-service#1645 - Manually trigger internal jobs" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Issues Created (org:teemtee)"
rlRun -s "did --config ./config-org.ini --gh-issues-created $YEAR_2022"
rlRun -s "$did ./config-org.ini --gh-issues-created $YEAR_2022"
rlAssertGrep "Issues created on gh: 30$" $rlRun_LOG
rlAssertGrep "teemtee/tmt#1737 - Introduce a new step for cleanup tasks" $rlRun_LOG
rlAssertGrep "teemtee/fmf#149 - Checkout of the default branch fails" $rlRun_LOG
rlAssertNotGrep "packit/packit-service#1645 - Manually trigger internal jobs" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Issues Created (org:teemtee,packit)"
rlRun -s "did --config ./config-more.ini --gh-issues-created $YEAR_2023"
rlRun -s "$did ./config-more.ini --gh-issues-created $YEAR_2023"
rlAssertGrep "Issues created on gh: 33$" $rlRun_LOG
rlAssertGrep "teemtee/tmt#2493 - Implement retry functionality" $rlRun_LOG
rlAssertGrep "packit/packit#1989 - Mention branch name" $rlRun_LOG
rlAssertNotGrep "readthedocs/sphinx_rtd_theme#1525 - Left menu" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Issues Created (repo:teemtee/fmf)"
rlRun -s "did --config ./config-repo.ini --gh-issues-created $YEAR_2022"
rlRun -s "$did ./config-repo.ini --gh-issues-created $YEAR_2022"
rlAssertGrep "Issues created on gh: 2$" $rlRun_LOG
rlAssertNotGrep "teemtee/tmt#1737 - Introduce a new step for cleanup tasks" $rlRun_LOG
rlAssertGrep "teemtee/fmf#149 - Checkout of the default branch fails" $rlRun_LOG
rlAssertNotGrep "packit/packit-service#1645 - Manually trigger internal jobs" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Issues Created (user:psss)"
rlRun -s "did --config ./config-user.ini --gh-issues-created $YEAR_2021"
rlRun -s "$did ./config-user.ini --gh-issues-created $YEAR_2021"
rlAssertGrep "Issues created on gh: 1$" $rlRun_LOG
rlAssertGrep "psss/did#247 - Implement pagination for the GitHub plugin" $rlRun_LOG
rlAssertNotGrep "packit/packit#1386 - Allow to disable web access" $rlRun_LOG
Expand All @@ -52,31 +54,31 @@ rlJournalStart
# Issues Closed

rlPhaseStartTest "Issues Closed"
rlRun -s "did --config ./config-default.ini --gh-issues-closed $YEAR_2022"
rlRun -s "$did ./config-default.ini --gh-issues-closed $YEAR_2022"
rlAssertGrep "Issues closed on gh: 17$" $rlRun_LOG
rlAssertGrep "teemtee/fmf#014 - Define a way how to undefine an attribute" $rlRun_LOG
rlAssertGrep "teemtee/tmt#991 - Incompatible environment variable name" $rlRun_LOG
rlAssertGrep "psss/did#269 - Invalid plugin type 'google'" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Issues Closed (org:teemtee)"
rlRun -s "did --config ./config-org.ini --gh-issues-closed $YEAR_2022"
rlRun -s "$did ./config-org.ini --gh-issues-closed $YEAR_2022"
rlAssertGrep "Issues closed on gh: 15$" $rlRun_LOG
rlAssertGrep "teemtee/fmf#014 - Define a way how to undefine an attribute" $rlRun_LOG
rlAssertGrep "teemtee/tmt#991 - Incompatible environment variable name" $rlRun_LOG
rlAssertNotGrep "psss/did#269 - Invalid plugin type 'google'" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Issues Closed (repo:teemtee/fmf)"
rlRun -s "did --config ./config-repo.ini --gh-issues-closed $YEAR_2022"
rlRun -s "$did ./config-repo.ini --gh-issues-closed $YEAR_2022"
rlAssertGrep "Issues closed on gh: 3$" $rlRun_LOG
rlAssertGrep "teemtee/fmf#014 - Define a way how to undefine an attribute" $rlRun_LOG
rlAssertNotGrep "teemtee/tmt#991 - Incompatible environment variable name" $rlRun_LOG
rlAssertNotGrep "psss/did#269 - Invalid plugin type 'google'" $rlRun_LOG
rlPhaseEnd

rlPhaseStartTest "Issues Closed (user:psss)"
rlRun -s "did --config ./config-user.ini --gh-issues-closed $YEAR_2022"
rlRun -s "$did ./config-user.ini --gh-issues-closed $YEAR_2022"
rlAssertGrep "Issues closed on gh: 1$" $rlRun_LOG
rlAssertNotGrep "teemtee/fmf#014 - Define a way how to undefine an attribute" $rlRun_LOG
rlAssertNotGrep "teemtee/tmt#991 - Incompatible environment variable name" $rlRun_LOG
Expand Down
20 changes: 11 additions & 9 deletions tests/github/pulls.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1

did="did --config"

YEAR_2022="--since 2022-01-01 --until 2022-12-31"
YEAR_2021="--since 2021-01-01 --until 2021-12-31"

Expand All @@ -9,7 +11,7 @@ rlJournalStart
# Pull Requests Created

rlPhaseStartTest "Pull Requests Created"
rlRun -s "did --config ./config-default.ini --gh-pull-requests-created $YEAR_2022"
rlRun -s "$did ./config-default.ini --gh-pull-requests-created $YEAR_2022"
rlAssertGrep "Pull requests created on gh: 94$" $rlRun_LOG
rlAssertGrep "teemtee/tmt#1750 - Include the new web link in verbose" $rlRun_LOG
rlAssertGrep "teemtee/fmf#170 - Implement a directive for disabling inheritance" $rlRun_LOG
Expand All @@ -20,7 +22,7 @@ rlJournalStart
rlPhaseEnd

rlPhaseStartTest "Pull Requests Created (org:teemtee)"
rlRun -s "did --config ./config-org.ini --gh-pull-requests-created $YEAR_2022"
rlRun -s "$did ./config-org.ini --gh-pull-requests-created $YEAR_2022"
rlAssertGrep "Pull requests created on gh: 85$" $rlRun_LOG
rlAssertGrep "teemtee/tmt#1750 - Include the new web link in verbose" $rlRun_LOG
rlAssertGrep "teemtee/fmf#170 - Implement a directive for disabling inheritance" $rlRun_LOG
Expand All @@ -31,7 +33,7 @@ rlJournalStart
rlPhaseEnd

rlPhaseStartTest "Pull Requests Created (org:teemtee,packit)"
rlRun -s "did --config ./config-more.ini --gh-pull-requests-created $YEAR_2022"
rlRun -s "$did ./config-more.ini --gh-pull-requests-created $YEAR_2022"
rlAssertGrep "Pull requests created on gh: 86$" $rlRun_LOG
rlAssertGrep "teemtee/tmt#1750 - Include the new web link in verbose" $rlRun_LOG
rlAssertGrep "teemtee/fmf#170 - Implement a directive for disabling inheritance" $rlRun_LOG
Expand All @@ -42,7 +44,7 @@ rlJournalStart
rlPhaseEnd

rlPhaseStartTest "Pull Requests Created (repo:teemtee/fmf)"
rlRun -s "did --config ./config-repo.ini --gh-pull-requests-created $YEAR_2022"
rlRun -s "$did ./config-repo.ini --gh-pull-requests-created $YEAR_2022"
rlAssertGrep "Pull requests created on gh: 7$" $rlRun_LOG
rlAssertNotGrep "teemtee/tmt#1750 - Include the new web link in verbose" $rlRun_LOG
rlAssertGrep "teemtee/fmf#170 - Implement a directive for disabling inheritance" $rlRun_LOG
Expand All @@ -53,7 +55,7 @@ rlJournalStart
rlPhaseEnd

rlPhaseStartTest "Pull Requests Created (user:psss)"
rlRun -s "did --config ./config-user.ini --gh-pull-requests-created $YEAR_2022"
rlRun -s "$did ./config-user.ini --gh-pull-requests-created $YEAR_2022"
rlAssertGrep "Pull requests created on gh: 7$" $rlRun_LOG
rlAssertNotGrep "teemtee/tmt#1750 - Include the new web link in verbose" $rlRun_LOG
rlAssertNotGrep "teemtee/fmf#170 - Implement a directive for disabling inheritance" $rlRun_LOG
Expand All @@ -66,7 +68,7 @@ rlJournalStart
# Pull Requests Closed

rlPhaseStartTest "Pull Requests Closed"
rlRun -s "did --config ./config-default.ini --gh-pull-requests-closed $YEAR_2022"
rlRun -s "$did ./config-default.ini --gh-pull-requests-closed $YEAR_2022"
rlAssertGrep "Pull requests closed on gh: 315$" $rlRun_LOG
rlAssertGrep "psss/did#272 - Koji plugin" $rlRun_LOG
rlAssertGrep "psss/python-nitrate#038 - Properly handle string" $rlRun_LOG
Expand All @@ -76,7 +78,7 @@ rlJournalStart
rlPhaseEnd

rlPhaseStartTest "Pull Requests Closed (org:teemtee)"
rlRun -s "did --config ./config-org.ini --gh-pull-requests-closed $YEAR_2022"
rlRun -s "$did ./config-org.ini --gh-pull-requests-closed $YEAR_2022"
rlAssertGrep "Pull requests closed on gh: 305$" $rlRun_LOG
rlAssertNotGrep "psss/did#272 - Koji plugin" $rlRun_LOG
rlAssertNotGrep "psss/python-nitrate#038 - Properly handle string" $rlRun_LOG
Expand All @@ -86,7 +88,7 @@ rlJournalStart
rlPhaseEnd

rlPhaseStartTest "Pull Requests Closed (repo:teemtee/fmf)"
rlRun -s "did --config ./config-repo.ini --gh-pull-requests-closed $YEAR_2022"
rlRun -s "$did ./config-repo.ini --gh-pull-requests-closed $YEAR_2022"
rlAssertGrep "Pull requests closed on gh: 13$" $rlRun_LOG
rlAssertNotGrep "psss/did#272 - Koji plugin" $rlRun_LOG
rlAssertNotGrep "psss/python-nitrate#038 - Properly handle string" $rlRun_LOG
Expand All @@ -96,7 +98,7 @@ rlJournalStart
rlPhaseEnd

rlPhaseStartTest "Pull Requests Closed (user:psss)"
rlRun -s "did --config ./config-user.ini --gh-pull-requests-closed $YEAR_2022"
rlRun -s "$did ./config-user.ini --gh-pull-requests-closed $YEAR_2022"
rlAssertGrep "Pull requests closed on gh: 10$" $rlRun_LOG
rlAssertGrep "psss/did#272 - Koji plugin" $rlRun_LOG
rlAssertGrep "psss/python-nitrate#038 - Properly handle string" $rlRun_LOG
Expand Down

0 comments on commit 145861e

Please sign in to comment.