source-controller icon indicating copy to clipboard operation
source-controller copied to clipboard

Add test for http bearer-token auth

Open Santosh1176 opened this issue 1 year ago • 0 comments

Add test for HTTP bearer-token auth.

=== RUN   TestGitRepositoryReconciler_reconcileSource_authStrategy/HTTP_with_bearer-token_secret_makes_Reconciling=True
2023/03/27 19:51:47 http: TLS handshake error from 127.0.0.1:50948: remote error: tls: bad certificate
2023/03/27 19:51:47 request: GET 127.0.0.1:36123/test.git/info/refs?service=git-receive-pack
2023/03/27 19:51:47 request: POST 127.0.0.1:36123/test.git/git-receive-pack
2023/03/27 19:51:47 request: GET 127.0.0.1:41101/test.git/info/refs?service=git-upload-pack
2023/03/27 19:51:47 request: POST 127.0.0.1:41101/test.git/git-upload-pack
=== RUN   TestGitRepositoryReconciler_reconcileSource_authStrategy/SSH_with_private_key_secret_makes_Reconciling=True
<snip>
.
.
<snip>
--- PASS: TestGitRepositoryReconciler_reconcileSource_authStrategy (3.19s)
    --- PASS: TestGitRepositoryReconciler_reconcileSource_authStrategy/HTTP_without_secretRef_makes_Reconciling=True (0.13s)
    --- PASS: TestGitRepositoryReconciler_reconcileSource_authStrategy/HTTP_with_Basic_Auth_secret_makes_Reconciling=True (0.11s)
    --- PASS: TestGitRepositoryReconciler_reconcileSource_authStrategy/HTTPS_with_CAFile_secret_makes_Reconciling=True (0.12s)
    --- PASS: TestGitRepositoryReconciler_reconcileSource_authStrategy/HTTPS_with_invalid_CAFile_secret_makes_CheckoutFailed=True_and_returns_error (0.07s)
    --- PASS: TestGitRepositoryReconciler_reconcileSource_authStrategy/HTTP_with_bearer-token_secret_makes_Reconciling=True (0.15s)
    --- PASS: TestGitRepositoryReconciler_reconcileSource_authStrategy/SSH_with_private_key_secret_makes_Reconciling=True (0.50s)
    --- PASS: TestGitRepositoryReconciler_reconcileSource_authStrategy/SSH_with_password_protected_private_key_secret_makes_Reconciling=True (1.74s)
    --- PASS: TestGitRepositoryReconciler_reconcileSource_authStrategy/Include_get_failure_makes_CheckoutFailed=True_and_returns_error (0.16s)
    --- PASS: TestGitRepositoryReconciler_reconcileSource_authStrategy/Existing_artifact_makes_ArtifactOutdated=True (0.20s)
PASS
        github.com/fluxcd/source-controller/controllers coverage: 4.1% of statements

This PR closes #1005

Santosh1176 avatar Mar 27 '23 14:03 Santosh1176