Skip to content

Commit

Permalink
Merge pull request #124 from wetneb/self_test_suite
Browse files Browse the repository at this point in the history
  • Loading branch information
aspiers committed Sep 22, 2023
2 parents caba2b5 + b268b72 commit 669a4cb
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch the entire repository so that we can use it for our self tests
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
Expand All @@ -41,3 +43,6 @@ jobs:
- name: Test with pytest
run: |
pytest
- name: Run the self-test suite
run: |
tests/self_test.sh
3 changes: 3 additions & 0 deletions tests/expected_outputs/deps_1ba7ad5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2bd9ea0f03a644cc3f5e7824d9ad0979ccdf94dc
2c9d23b0291157eb1096384ff76e0122747b9bdf
c15f0364bf0364b8123b370b78b6d6ac8bf6f779
7 changes: 7 additions & 0 deletions tests/expected_outputs/deps_4f27a1e
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
3374b8419a45d91d3c0631be11c8cf893b272217
3a1dd42fd6114a634ba7cf037ce61e2aee76db73
5ec5ccbdff508014c61ae9d18f3366a15c0f2689
80c247fd21a1e7f476d1c8ba289498e216eff3dc
b144bfd5feb327ef7ce0c26bbfb6f4da573abfe5
b1967573e81a8100a4cc778936de0ba0a8a8f5cb
f7bf058439fd7499aad7a10418a9f516e6949fbc
Empty file.
23 changes: 23 additions & 0 deletions tests/self_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -eo pipefail

# Collection of tests consisting in running `git-deps` on its own repository.
# The expected outputs of various commands are stored in the `expected_outputs` subdirectory.

# Because git-deps can only be run from the repository's root, this script should be run at
# the root of a clone of git-deps. The clone should not be shallow, so that all refs can be accessed.

echo "Running test suite"

echo "* Dependencies of 4f27a1e, a regular commit"
git-deps 4f27a1e^! | sort | diff tests/expected_outputs/deps_4f27a1e -

echo "* Dependencies of 1ba7ad5, a merge commit"
git-deps 1ba7ad5^! | sort | diff tests/expected_outputs/deps_1ba7ad5 -

# Currently failing:
#echo "* Dependencies of the root commit"
# git-deps b196757^! | sort # | diff tests/expected_outputs/deps_b196757 -

echo "All tests passed!"

0 comments on commit 669a4cb

Please sign in to comment.