FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
semaphore-ex/db/sql/environment_sync_test.go at develop · freefair/semaphore-ex · GitHub
freefair
/
semaphore-ex
Public
forked from
semaphoreui/semaphore
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
2
Actions
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
semaphore-ex
/
db
/
sql
/
environment_sync_test.go
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (21 loc) · 954 Bytes
Breadcrumbs
semaphore-ex
/
db
/
sql
/
environment_sync_test.go
Copy path
File metadata and controls
26 lines (21 loc) · 954 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package
sql
import
(
"testing"
"github.com/semaphoreui/semaphore/db"
"github.com/stretchr/testify/require"
)
func
TestEnvironmentSecretSyncDirectionDependsOnManagedPaths
(
t
*
testing.
T
) {
storageID
:=
9
withoutPaths
:=
environmentSecretSync
(db.
Environment
{
ID
:
1
,
ProjectID
:
2
,
SecretStorageID
:
&
storageID
,
SyncEnabled
:
true
,
SyncInterval
:
15
})
// SaveSecretSync normalizes this empty direction to read_only, preserving
// existing pull-only storage-sync behavior.
require
.
Empty
(
t
,
withoutPaths
.
Direction
)
require
.
True
(
t
,
withoutPaths
.
SyncEnabled
)
require
.
Equal
(
t
,
15
,
withoutPaths
.
SyncInterval
)
withPaths
:=
environmentSecretSync
(db.
Environment
{
ID
:
1
,
ProjectID
:
2
,
SecretStorageID
:
&
storageID
,
SyncPaths
: []db.
SecretSyncPath
{{
AccessKeyID
:
3
,
Mount
:
"secret"
,
Path
:
"applications/test"
,
Field
:
"token"
}},
})
require
.
Equal
(
t
,
db
.
SecretSyncDirectionOutbound
,
withPaths
.
Direction
)
require
.
Equal
(
t
,
3
,
withPaths
.
Paths
[
0
].
AccessKeyID
)
}
Back
|
FazBrowse Home
|
New Git URL