Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Job Queues
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Libraries
Go
Services
Job Queues
Commits
0d3bdc7c
Verified
Commit
0d3bdc7c
authored
Oct 23, 2023
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
fix: ci pipeline
parent
d3015400
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
docker.go
+5
-0
5 additions, 0 deletions
docker.go
runnable-mail_test.go
+6
-5
6 additions, 5 deletions
runnable-mail_test.go
runnable-sftp_test.go
+9
-10
9 additions, 10 deletions
runnable-sftp_test.go
with
20 additions
and
15 deletions
docker.go
0 → 100644
+
5
−
0
View file @
0d3bdc7c
package
jobqueue
const
(
DOCKER_TEST_HOST_IP
=
"172.17.0.1"
)
This diff is collapsed.
Click to expand it.
runnable-mail_test.go
+
6
−
5
View file @
0d3bdc7c
...
@@ -33,6 +33,9 @@ func startTestSMTPDockerImageAndContainer(t *testing.T, port string, ctx context
...
@@ -33,6 +33,9 @@ func startTestSMTPDockerImageAndContainer(t *testing.T, port string, ctx context
_
=
reader
_
=
reader
host
,
_
,
_
:=
net
.
SplitHostPort
(
cli
.
DaemonHost
())
host
,
_
,
_
:=
net
.
SplitHostPort
(
cli
.
DaemonHost
())
if
host
==
""
||
host
==
"unix"
{
host
=
DOCKER_TEST_HOST_IP
}
hostConfig
:=
&
container
.
HostConfig
{
hostConfig
:=
&
container
.
HostConfig
{
PortBindings
:
nat
.
PortMap
{
PortBindings
:
nat
.
PortMap
{
...
@@ -109,9 +112,7 @@ func TestMailRunner(t *testing.T) {
...
@@ -109,9 +112,7 @@ func TestMailRunner(t *testing.T) {
time
.
Sleep
(
1
*
time
.
Second
)
time
.
Sleep
(
1
*
time
.
Second
)
})
})
host
:=
"172.17.0.1"
listener
,
err
:=
net
.
Listen
(
"tcp"
,
DOCKER_TEST_HOST_IP
+
":0"
)
listener
,
err
:=
net
.
Listen
(
"tcp"
,
host
+
":0"
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
return
return
...
@@ -133,7 +134,7 @@ func TestMailRunner(t *testing.T) {
...
@@ -133,7 +134,7 @@ func TestMailRunner(t *testing.T) {
waitCtx
,
waitCancel
:=
context
.
WithTimeout
(
ctx
,
60
*
time
.
Second
)
waitCtx
,
waitCancel
:=
context
.
WithTimeout
(
ctx
,
60
*
time
.
Second
)
defer
waitCancel
()
defer
waitCancel
()
for
{
for
{
conn
,
err
:=
net
.
DialTimeout
(
"tcp"
,
net
.
JoinHostPort
(
host
,
portAsString
),
1
*
time
.
Second
)
conn
,
err
:=
net
.
DialTimeout
(
"tcp"
,
net
.
JoinHostPort
(
DOCKER_TEST_HOST_IP
,
portAsString
),
1
*
time
.
Second
)
if
err
==
nil
{
if
err
==
nil
{
err
=
conn
.
Close
()
err
=
conn
.
Close
()
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
...
@@ -156,7 +157,7 @@ func TestMailRunner(t *testing.T) {
...
@@ -156,7 +157,7 @@ func TestMailRunner(t *testing.T) {
From
:
"from@example.com"
,
From
:
"from@example.com"
,
Subject
:
"this is a test"
,
Subject
:
"this is a test"
,
Body
:
"this is the body"
,
Body
:
"this is the body"
,
Server
:
host
,
Server
:
DOCKER_TEST_HOST_IP
,
Port
:
portAsString
,
Port
:
portAsString
,
Username
:
""
,
Username
:
""
,
Password
:
""
,
Password
:
""
,
...
...
This diff is collapsed.
Click to expand it.
runnable-sftp_test.go
+
9
−
10
View file @
0d3bdc7c
...
@@ -34,6 +34,9 @@ func startSFTPTestDockerImageAndContainer(t *testing.T, port string, volume stri
...
@@ -34,6 +34,9 @@ func startSFTPTestDockerImageAndContainer(t *testing.T, port string, volume stri
_
=
reader
_
=
reader
host
,
_
,
_
:=
net
.
SplitHostPort
(
cli
.
DaemonHost
())
host
,
_
,
_
:=
net
.
SplitHostPort
(
cli
.
DaemonHost
())
if
host
==
""
||
host
==
"unix"
{
host
=
DOCKER_TEST_HOST_IP
}
hostConfig
:=
&
container
.
HostConfig
{
hostConfig
:=
&
container
.
HostConfig
{
PortBindings
:
nat
.
PortMap
{
PortBindings
:
nat
.
PortMap
{
...
@@ -109,9 +112,7 @@ func TestSFTPCRunnerLocalToRemote(t *testing.T) {
...
@@ -109,9 +112,7 @@ func TestSFTPCRunnerLocalToRemote(t *testing.T) {
time
.
Sleep
(
1
*
time
.
Second
)
time
.
Sleep
(
1
*
time
.
Second
)
})
})
host
:=
"172.17.0.1"
listener
,
err
:=
net
.
Listen
(
"tcp"
,
DOCKER_TEST_HOST_IP
+
":0"
)
listener
,
err
:=
net
.
Listen
(
"tcp"
,
host
+
":0"
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
return
return
...
@@ -133,7 +134,7 @@ func TestSFTPCRunnerLocalToRemote(t *testing.T) {
...
@@ -133,7 +134,7 @@ func TestSFTPCRunnerLocalToRemote(t *testing.T) {
waitCtx
,
waitCancel
:=
context
.
WithTimeout
(
ctx
,
60
*
time
.
Second
)
waitCtx
,
waitCancel
:=
context
.
WithTimeout
(
ctx
,
60
*
time
.
Second
)
defer
waitCancel
()
defer
waitCancel
()
for
{
for
{
conn
,
err
:=
net
.
DialTimeout
(
"tcp"
,
net
.
JoinHostPort
(
host
,
portAsString
),
1
*
time
.
Second
)
conn
,
err
:=
net
.
DialTimeout
(
"tcp"
,
net
.
JoinHostPort
(
DOCKER_TEST_HOST_IP
,
portAsString
),
1
*
time
.
Second
)
if
err
==
nil
{
if
err
==
nil
{
err
=
conn
.
Close
()
err
=
conn
.
Close
()
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
...
@@ -162,7 +163,7 @@ func TestSFTPCRunnerLocalToRemote(t *testing.T) {
...
@@ -162,7 +163,7 @@ func TestSFTPCRunnerLocalToRemote(t *testing.T) {
}
}
sftpRunnable
:=
&
SFTPRunnable
{
sftpRunnable
:=
&
SFTPRunnable
{
Host
:
host
,
Host
:
DOCKER_TEST_HOST_IP
,
Port
:
portAsInt
,
Port
:
portAsInt
,
User
:
"demo"
,
User
:
"demo"
,
Insecure
:
true
,
Insecure
:
true
,
...
@@ -204,9 +205,7 @@ func TestSFTPCRunnerRemoteToLocal(t *testing.T) {
...
@@ -204,9 +205,7 @@ func TestSFTPCRunnerRemoteToLocal(t *testing.T) {
time
.
Sleep
(
1
*
time
.
Second
)
time
.
Sleep
(
1
*
time
.
Second
)
})
})
host
:=
"127.0.0.1"
listener
,
err
:=
net
.
Listen
(
"tcp"
,
DOCKER_TEST_HOST_IP
+
":0"
)
listener
,
err
:=
net
.
Listen
(
"tcp"
,
host
+
":0"
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
return
return
...
@@ -238,7 +237,7 @@ func TestSFTPCRunnerRemoteToLocal(t *testing.T) {
...
@@ -238,7 +237,7 @@ func TestSFTPCRunnerRemoteToLocal(t *testing.T) {
waitCtx
,
waitCancel
:=
context
.
WithTimeout
(
ctx
,
60
*
time
.
Second
)
waitCtx
,
waitCancel
:=
context
.
WithTimeout
(
ctx
,
60
*
time
.
Second
)
defer
waitCancel
()
defer
waitCancel
()
for
{
for
{
conn
,
err
:=
net
.
DialTimeout
(
"tcp"
,
net
.
JoinHostPort
(
host
,
portAsString
),
1
*
time
.
Second
)
conn
,
err
:=
net
.
DialTimeout
(
"tcp"
,
net
.
JoinHostPort
(
DOCKER_TEST_HOST_IP
,
portAsString
),
1
*
time
.
Second
)
if
err
==
nil
{
if
err
==
nil
{
err
=
conn
.
Close
()
err
=
conn
.
Close
()
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
...
@@ -259,7 +258,7 @@ func TestSFTPCRunnerRemoteToLocal(t *testing.T) {
...
@@ -259,7 +258,7 @@ func TestSFTPCRunnerRemoteToLocal(t *testing.T) {
tempDir
:=
t
.
TempDir
()
tempDir
:=
t
.
TempDir
()
sftpRunnable
:=
&
SFTPRunnable
{
sftpRunnable
:=
&
SFTPRunnable
{
Host
:
host
,
Host
:
DOCKER_TEST_HOST_IP
,
Port
:
portAsInt
,
Port
:
portAsInt
,
User
:
"demo"
,
User
:
"demo"
,
Insecure
:
true
,
Insecure
:
true
,
...
...
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