Skip to content

Commit

Permalink
[clone] add remaining journey tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 11, 2020
1 parent 25cdd63 commit 354e63f
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Please see _'Development Status'_ for a listing of all crates and their capabili
* [x] [pack index verify](https://asciinema.org/a/352945) including each object sha1 and statistics
* [x] [pack explode](https://asciinema.org/a/352951), useful for transforming packs into loose objects for inspection or restoration
* [x] verify written objects (by reading them back from disk)
* [ ] **pack-receive** - receive a pack produced by **pack-send** or _git-upload-pack_
* [x] **pack-receive** - receive a pack produced by **pack-send** or _git-upload-pack_
* [ ] **pack-send** - create a pack and send it using the pack protocol to stdout, similar to 'git-upload-pack',
for consumption by **pack-receive** or _git-receive-pack_
* **pack-index**
Expand Down Expand Up @@ -117,7 +117,7 @@ Please see _'Development Status'_ for a listing of all crates and their capabili
* [x] abort early for ls-remote capabilities
* [x] packfile negotiation
* [x] delegate can support for all fetch features, including shallow, deepen, etc.
* [ ] receive parsed shallow feature
* [ ] receive parsed shallow refs
* [ ] push
* [ ] API documentation with examples

Expand Down
12 changes: 6 additions & 6 deletions tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
* **gixp-pack-receive**
* [x] hookup `git-protocol` with delegate to allow for receiving full packs
* [x] json support
* [ ] **gixp-pack-receive** may optionally write received refs to the specified directory
* [ ] journey tests for each connection method
* [ ] may optionally write received refs to the specified directory
* [x] journey tests for each connection method
* [x] file
* [ ] git
* [ ] ssh
* [ ] https (unauthenticated)
* [ ] https (authenticated)
* [x] git
* [ ] ~~ssh~~
* [x] https (unauthenticated)
* [ ] ~~https (authenticated)~~

### NEXT ITERATION: Fetching _(more analysis needed after previous block)_

Expand Down
63 changes: 57 additions & 6 deletions tests/stateless-journey.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ function small-repo-in-sandbox() {
} &>/dev/null
}

function launch_git_daemon() {
git daemon --verbose --base-path=. --export-all --user-path &>/dev/null &
daemon_pid=$!
while ! nc -z localhost 9418; do
sleep 0.1
done
trap 'kill $daemon_pid' EXIT
}

title plumbing
snapshot="$snapshot/plumbing"
(when "running 'pack-receive'"
Expand Down Expand Up @@ -134,6 +143,53 @@ snapshot="$snapshot/plumbing"
fi
)
)
(with "git:// protocol"
launch_git_daemon
(with "version 1"
(with "NO output directory"
it "generates the correct output" && {
WITH_SNAPSHOT="$snapshot/file-v-any-no-output" \
expect_run $SUCCESSFULLY "$exe_plumbing" pack-receive -p 1 git://localhost/
}
)
(with "output directory"
it "generates the correct output" && {
WITH_SNAPSHOT="$snapshot/file-v-any-with-output" \
expect_run $SUCCESSFULLY "$exe_plumbing" pack-receive -p 1 git://localhost/ out/
}
)
)
(with "version 2"
(with "NO output directory"
it "generates the correct output" && {
WITH_SNAPSHOT="$snapshot/file-v-any-no-output" \
expect_run $SUCCESSFULLY "$exe_plumbing" pack-receive -p 2 git://localhost/
}
)
(with "output directory"
it "generates the correct output" && {
WITH_SNAPSHOT="$snapshot/file-v-any-with-output" \
expect_run $SUCCESSFULLY "$exe_plumbing" pack-receive git://localhost/ out/
}
)
)
)
(on_ci
if test "$kind" = "max"; then
(with "https:// protocol"
(with "version 1"
it "works" && {
expect_run $SUCCESSFULLY "$exe_plumbing" pack-receive -p 1 https://github.com/byron/gitoxide
}
)
(with "version 2"
it "works" && {
expect_run $SUCCESSFULLY "$exe_plumbing" pack-receive -p 2 https://github.com/byron/gitoxide
}
)
)
fi
)
)
)
(when "running 'remote-ref-list'"
Expand Down Expand Up @@ -162,12 +218,7 @@ snapshot="$snapshot/plumbing"
fi
)
(with "git:// protocol"
git daemon --verbose --base-path=. --export-all --user-path &>/dev/null &
daemon_pid=$!
while ! nc -z localhost 9418; do
sleep 0.1
done
trap 'kill $daemon_pid' EXIT
launch_git_daemon
(with "version 1"
it "generates the correct output" && {
WITH_SNAPSHOT="$snapshot/file-v-any" \
Expand Down

0 comments on commit 354e63f

Please sign in to comment.