Repository navigation
add unit, integration and e2e tests for backend git flows #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mellowagain
wants to merge
14
commits into
main
Choose a base branch
from
tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,716
−41
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
faaa6f3
add unit, integration and e2e tests for backend
mellowagain 12aa0fa
review
mellowagain e00880a
fix tests
mellowagain 66f4aa3
Merge branch 'main' into tests
mellowagain 645f164
set warning to error
mellowagain f1e39c4
Merge branch 'main' into tests
mellowagain 5117d16
display test results
mellowagain 70874c1
Merge branch 'main' into tests
mellowagain ff7112e
Merge branch 'main' into tests
mellowagain b7dcf28
Merge branch 'main' into tests
mellowagain 73eff12
merge regression fix
mellowagain f88dbac
Merge branch 'main' into tests
mellowagain 0e2281e
Merge branch 'main' into tests
mellowagain 6a26b17
run tests only in test workflow
mellowagain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| [profile.default] | ||
| slow-timeout = { period = "60s", terminate-after = 3 } | ||
|
|
||
| [test-groups] | ||
| # every test boots its own server with a handful of Postgres connections, so this keeps the total under `max_connections` | ||
| git-server = { max-threads = 8 } | ||
|
|
||
| [[profile.default.overrides]] | ||
| filter = "package(gitarena) & kind(test)" | ||
| test-group = "git-server" | ||
|
|
||
| [profile.ci] | ||
| fail-fast = false | ||
|
|
||
| [profile.ci.junit] | ||
| path = "junit.xml" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: Git Tests | ||
|
|
||
| on: | ||
| - push | ||
| - pull_request | ||
|
|
||
| permissions: | ||
| contents: read | ||
| actions: read | ||
| checks: write | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| DATABASE_URL: postgres://gitarena:gitarena@localhost:5432/gitarena | ||
|
|
||
| jobs: | ||
| git-tests: | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| postgres: | ||
| image: postgres:18.6-trixie | ||
| env: | ||
| POSTGRES_USER: gitarena | ||
| POSTGRES_PASSWORD: gitarena | ||
| POSTGRES_DB: gitarena | ||
| ports: | ||
| - 5432:5432 | ||
| options: >- | ||
| --health-cmd "pg_isready -U gitarena" | ||
| --health-interval 5s | ||
| --health-timeout 5s | ||
| --health-retries 10 | ||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: install rust toolchain | ||
| uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1 | ||
| with: | ||
| toolchain: stable | ||
|
|
||
| - name: rust cache | ||
| uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 | ||
|
|
||
| - name: install cargo-nextest | ||
| uses: taiki-e/install-action@ab49d3c64680143e184118bed66a46419fc15519 # v2.90.5 | ||
| with: | ||
| tool: cargo-nextest | ||
|
|
||
| - name: install git-bug v0.11.0 | ||
| run: | | ||
| curl --proto "=https" --tlsv1.2 -sSf -L https://github.com/git-bug/git-bug/releases/download/v0.11.0/git-bug_linux_amd64 -o /usr/local/bin/git-bug | ||
| chmod +x /usr/local/bin/git-bug | ||
|
|
||
| - name: tool versions | ||
| run: | | ||
| git --version | ||
| ssh -V | ||
| git-bug version | ||
|
|
||
| - name: test | ||
| run: cargo nextest run --locked --workspace --profile ci | ||
|
|
||
| - name: upload test report | ||
| if: ${{ !cancelled() }} | ||
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | ||
| with: | ||
| name: git-tests-junit | ||
| path: target/nextest/ci/junit.xml | ||
|
|
||
| - name: display test report | ||
| uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 | ||
| if: ${{ !cancelled() }} | ||
| with: | ||
| name: Backend tests | ||
| path: target/nextest/ci/junit.xml | ||
| reporter: java-junit | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Install
git-bugwithsudoor into a user-writable location.The job runs as the non-root
runneruser. Thecurlcommand writes directly to/usr/local/bin/git-bugwithout elevation. That write can fail with permission denied. The failed step then stops the job before theteststep runs.Download to
$RUNNER_TEMP, then install withsudo:Suggested fix