H-300: wire Captain Skills into Web runtime (#48)
* H-300: wire Captain Skills into Web runtime * H-300: enforce effective model and conservative skill budget * H-300: fix CI gosec step * ci: extend golangci-lint timeout * fix lint findings across backend * fix(push): resolve delivery protocol blockers * test(repository): close SQLite test databases * test(repository): reuse SQLite schema per package * H-307: restore backend Go cache in CI * H-307: prefetch modules before cold lint * H-307: resolve govulncheck security gate * H-307: build lint with patched Go toolchain * H-307: clear remaining security scan findings --------- Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package webhook
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
@@ -47,5 +48,5 @@ func TestFacebookWebhookHandler_LookupInstagramInboxForEvent_Cov10(t *testing.T)
|
||||
func TestIncomingPersister_LoadInboxForStatusJob_Cov10(t *testing.T) {
|
||||
p := &IncomingPersister{}
|
||||
defer func() { _ = recover() }()
|
||||
_, _ = p.loadInboxForStatusJob(nil, 1)
|
||||
_, _ = p.loadInboxForStatusJob(context.Background(), 1)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package webhook
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
@@ -11,6 +12,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"gorm.io/datatypes"
|
||||
|
||||
"github.com/gochat/gochat/internal/channel"
|
||||
@@ -250,7 +252,7 @@ func TestFB_resolveAppSecret_NoSecret_Cov3(t *testing.T) {
|
||||
func TestFB_persistFacebookReceipt_NilPersister_Cov3(t *testing.T) {
|
||||
h := &FacebookWebhookHandler{}
|
||||
safeCall_Cov3(t, func() {
|
||||
h.persistFacebookReceipt(nil, nil, nil)
|
||||
h.persistFacebookReceipt(context.Background(), nil, nil)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -576,7 +578,7 @@ func TestTikTok_HandleVerification_Success_Cov3(t *testing.T) {
|
||||
h.HandleTikTokVerification(c)
|
||||
assert.Equal(t, http.StatusOK, w.Code)
|
||||
var resp map[string]interface{}
|
||||
json.Unmarshal(w.Body.Bytes(), &resp)
|
||||
require.NoError(t, json.Unmarshal(w.Body.Bytes(), &resp))
|
||||
assert.Equal(t, "mychallenge", resp["challenge"])
|
||||
}
|
||||
|
||||
@@ -789,19 +791,19 @@ func TestShopify_verifyHMAC_BadSig_Cov3(t *testing.T) {
|
||||
|
||||
func TestShopify_deleteShopifyHooksByDomain_NilDB_Cov3(t *testing.T) {
|
||||
h := &ShopifyWebhookHandler{db: nil, clientSecret: "secret"}
|
||||
err := h.deleteShopifyHooksByDomain(nil, "test.myshopify.com")
|
||||
err := h.deleteShopifyHooksByDomain(context.Background(), "test.myshopify.com")
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
||||
func TestShopify_findShopifyHookByDomain_NilDB_Cov3(t *testing.T) {
|
||||
h := &ShopifyWebhookHandler{db: nil, clientSecret: "secret"}
|
||||
_, err := h.findShopifyHookByDomain(nil, "test.myshopify.com")
|
||||
_, err := h.findShopifyHookByDomain(context.Background(), "test.myshopify.com")
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
||||
func TestShopify_shopifyHooks_NilDB_Cov3(t *testing.T) {
|
||||
h := &ShopifyWebhookHandler{db: nil, clientSecret: "secret"}
|
||||
_, err := h.shopifyHooks(nil, "test.myshopify.com")
|
||||
_, err := h.shopifyHooks(context.Background(), "test.myshopify.com")
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package webhook
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
@@ -226,20 +227,20 @@ func TestIncomingPersister_SetSearchIndexer_Nil_Cov4(t *testing.T) {
|
||||
|
||||
func TestIncomingPersister_PersistIncoming_NilPersister_Cov4(t *testing.T) {
|
||||
var p *IncomingPersister
|
||||
result, err := p.PersistIncoming(nil, nil, nil)
|
||||
result, err := p.PersistIncoming(context.Background(), nil, nil)
|
||||
assert.Nil(t, result)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
func TestIncomingPersister_UpdateMessageStatusWithError_Nil_Cov4(t *testing.T) {
|
||||
var p *IncomingPersister
|
||||
err := p.UpdateMessageStatusWithError(nil, nil, "", "", nil, "")
|
||||
err := p.UpdateMessageStatusWithError(context.Background(), nil, "", "", nil, "")
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
func TestIncomingPersister_UpdateContactConversationMessagesStatus_Nil_Cov4(t *testing.T) {
|
||||
var p *IncomingPersister
|
||||
err := p.UpdateContactConversationMessagesStatus(nil, nil, "", "", nil)
|
||||
err := p.UpdateContactConversationMessagesStatus(context.Background(), nil, "", "", nil)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user