Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: service logs workflow v2 #6684

Merged
merged 24 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: ut
Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>
  • Loading branch information
yesnault committed Nov 29, 2023
commit 661a8c62613770f95d17815282831e0aa84ced4d
14 changes: 7 additions & 7 deletions engine/hatchery/swarm/swarm_util_pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@ import (
"time"

"github.com/docker/docker/api/types"
"github.com/ovh/cds/sdk"
"github.com/stretchr/testify/require"
"gopkg.in/h2non/gock.v1"

"github.com/ovh/cds/sdk"
)

func Test_pullImage(t *testing.T) {
t.Cleanup(gock.Off)
defer gock.Off()

h := InitTestHatcherySwarm(t)

gock.New("https://lolcat.local").Post("/images/create").Times(5).AddMatcher(func(r *http.Request, rr *gock.Request) (bool, error) {
gock.New("https://lolcat.local").Post("/v6.66/images/create").Times(5).AddMatcher(func(r *http.Request, rr *gock.Request) (bool, error) {
values := r.URL.Query()

// Call 1
if values.Get("fromImage") == "my-registry.lolcat.local/my-image-1" && values.Get("tag") == "my-tag" {
if values.Get("fromImage") == "my-registry.lolcat.local/my-image-testpull-mage" && values.Get("tag") == "my-tag" {
return true, nil
}
// Call 2
Expand All @@ -34,7 +33,8 @@ func Test_pullImage(t *testing.T) {
buf, err := base64.StdEncoding.DecodeString(r.Header.Get("X-Registry-Auth"))
require.NoError(t, err)
var auth types.AuthConfig
require.NoError(t, json.Unmarshal(buf, &auth))
err = json.Unmarshal(buf, &auth)
require.NoError(t, err)

t.Log("Auth config", auth)

Expand All @@ -56,7 +56,7 @@ func Test_pullImage(t *testing.T) {
return false, nil
}).Reply(http.StatusOK)

require.NoError(t, h.pullImage(h.dockerClients["default"], "my-registry.lolcat.local/my-image-1:my-tag", time.Minute, sdk.WorkerStarterWorkerModel{ModelV1: &sdk.Model{}}))
require.NoError(t, h.pullImage(h.dockerClients["default"], "my-registry.lolcat.local/my-image-testpull-mage:my-tag", time.Minute, sdk.WorkerStarterWorkerModel{ModelV1: &sdk.Model{}}))
require.NoError(t, h.pullImage(h.dockerClients["default"], "my-image-2:my-tag", time.Minute, sdk.WorkerStarterWorkerModel{ModelV1: &sdk.Model{}}))

h.Config.RegistryCredentials = []RegistryCredential{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ require (
google.golang.org/grpc v1.56.3
google.golang.org/protobuf v1.31.0
gopkg.in/AlecAivazis/survey.v1 v1.7.1
gopkg.in/h2non/gock.v1 v1.0.14
gopkg.in/h2non/gock.v1 v1.1.2
gopkg.in/ldap.v2 v2.5.1
gopkg.in/spacemonkeygo/httpsig.v0 v0.0.0-20170228231032-6732593ec966
gopkg.in/square/go-jose.v2 v2.3.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1472,6 +1472,8 @@ gopkg.in/gorp.v1 v1.7.1 h1:GBB9KrWRATQZh95HJyVGUZrWwOPswitEYEyqlK8JbAA=
gopkg.in/gorp.v1 v1.7.1/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw=
gopkg.in/h2non/gock.v1 v1.0.14 h1:fTeu9fcUvSnLNacYvYI54h+1/XEteDyHvrVCZEEEYNM=
gopkg.in/h2non/gock.v1 v1.0.14/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE=
gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
Expand Down
40 changes: 0 additions & 40 deletions tests/06_sc_workflow_with_marathon.yml

This file was deleted.

11 changes: 0 additions & 11 deletions tests/fixtures/ITSCWRKFLW17/pipeline.yml

This file was deleted.

3 changes: 0 additions & 3 deletions tests/fixtures/ITSCWRKFLW17/workflow.yml

This file was deleted.

4 changes: 0 additions & 4 deletions tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ GPG_KEY_ID="${GPG_KEY_ID:-`gpg --list-secret-keys | grep --only-matching --exten

PLUGINS_DIRECTORY="${PLUGINS_DIRECTORY:-dist}"

# If you want to run some tests with a specific model requirements, set CDS_MODEL_REQ
CDS_MODEL_REQ="${CDS_MODEL_REQ:-buildpack-deps}"
# If you want to run some tests with a specific region requirement, set CDS_REGION_REQ
CDS_REGION_REQ="${CDS_REGION_REQ:-""}"

Expand Down Expand Up @@ -204,7 +202,6 @@ workflow_with_third_parties() {
check_failure $? 01_queue_stopall.yml.output
mv_results ${f}

if [ -z "$CDS_MODEL_REQ" ]; then echo "missing CDS_MODEL_REQ variable"; exit 1; fi
if [ -z "$CDS_REGION_REQ" ]; then echo "missing CDS_REGION_REQ variable"; exit 1; fi
if [ -z "$VENOM_VAR_projectKey" ]; then echo "missing VENOM_VAR_projectKey variable"; exit 1; fi
if [ -z "$VENOM_VAR_integrationName" ]; then echo "missing VENOM_VAR_integrationName variable"; exit 1; fi
Expand Down Expand Up @@ -273,7 +270,6 @@ for target in $@; do
workflow_with_integration_tests
admin_tests;;
workflow_with_third_parties)
export CDS_MODEL_REQ
export CDS_REGION_REQ
workflow_with_third_parties;;
admin)
Expand Down