Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
hg-git
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
hg-git
Commits
620730dd0f5d
Commit
620730dd0f5d
authored
3 years ago
by
Dan Villiom Podlaski Christiansen
Browse files
Options
Downloads
Patches
Plain Diff
tests: add anonymous HTTP test using dulwich.web
parent
5cb91e8a6b4f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!127
Remove some unnecessary caching
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test-serve-dulwich.t
+28
-6
28 additions, 6 deletions
tests/test-serve-dulwich.t
tests/testlib/dulwich-serve.py
+22
-0
22 additions, 0 deletions
tests/testlib/dulwich-serve.py
with
50 additions
and
6 deletions
tests/test-serve-
git
.t
→
tests/test-serve-
dulwich
.t
+
28
−
6
View file @
620730dd
#require serve
Check
cloning
a
Git
repository
over
anonymous
HTTP
,
served
up
by
Dulwich
.
The
script
uses
`
os.fork()
`,
so
this
doesn
'
t work on Windows.
Load commonly used test logic
$ . "$TESTDIR/testutil"
...
...
@@ -13,9 +16,6 @@
$ echo bar > bar
$ git add bar
$ fn_git_commit -m test
$
git
daemon
--
listen
=
localhost
--
port
=
$HGPORT
\
>
--
pid
-
file
=
$DAEMON_PIDS
--
detach
--
export
-
all
--
verbose
\
>
--
base
-
path
=
$TESTTMP
\
>
||
exit
80
$ $PYTHON $TESTDIR/testlib/dulwich-serve.py --port=$HGPORT
$ cd ..
...
...
@@ -20,4 +20,4 @@
$ cd ..
Make
sure
that
clone
over
the
old
git
protocol
doesn
'
t break
Make sure that clone over
unauthenticated HTTP
doesn
'
t
break
...
...
@@ -23,6 +23,6 @@
$ hg clone -U git://localhost:$HGPORT
/test
copy 2>&1
$
hg
clone
-
U
git
+
http
:
//local
host:$HGPORT
copy
2
>&
1
importing
git
objects
into
hg
$
hg
log
-
T
'
HG:{node|short} GIT:{gitnode|short}\n
'
-
R
copy
HG:221dd250e933
GIT:3af9773036a9
HG:c4d188f6e13d
GIT:b23744d34f97
...
...
@@ -25,4 +25,26 @@
importing
git
objects
into
hg
$
hg
log
-
T
'
HG:{node|short} GIT:{gitnode|short}\n
'
-
R
copy
HG:221dd250e933
GIT:3af9773036a9
HG:c4d188f6e13d
GIT:b23744d34f97
$
cd
copy
$
hg
up
master
2
files
updated
,
0
files
merged
,
0
files
removed
,
0
files
unresolved
(
activating
bookmark
master
)
$
echo
baz
>
baz
$
fn_hg_commit
-
A
-
m baz
$ hg push
pushing to git+http://localhost:$HGPORT/
searching for changes
adding ob
jects
added
1
commits
with
1
trees
and
1
blobs
updating
reference
refs
/heads/mas
ter
$
hg
log
-
T
'
HG:{node|short} GIT:{gitnode|short}\n
'
-
r
.
HG:daf1ae153bf8
GIT:ab88565d0614
Prevent
the
test
from
hanging:
$
cat
$DAEMON_PIDS
|
xargs
kill
(
As
an
aside
,
don
'
t use `pkill -F` -- that doesn
'
t
work
and
causes
a
hang
on
Alpine
.
)
This diff is collapsed.
Click to expand it.
tests/testlib/dulwich-serve.py
0 → 100755
+
22
−
0
View file @
620730dd
#!/usr/bin/env python3
#
# Wrapper for dulwich.web that forks a web server in a subprocess and
# saves the PID.
#
import
os
import
subprocess
import
sys
proc
=
subprocess
.
Popen
(
[
sys
.
executable
,
"
-m
"
,
"
dulwich.web
"
,
]
+
sys
.
argv
[
1
:],
stderr
=
subprocess
.
DEVNULL
,
)
with
open
(
os
.
getenv
(
"
DAEMON_PIDS
"
),
"
a
"
)
as
fp
:
fp
.
write
(
"
%d
\n
"
%
proc
.
pid
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment