• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jtblin / kube2iam
58%
master: 8%

Build:
Build:
LAST BUILD BRANCH: feature/5-increase-coverage-and-add-integration-and-e2e-tests
DEFAULT BRANCH: master
Repo Added 24 Jun 2017 11:10AM UTC
Files 10
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH feature/5-increase-coverage-and-add-integration-and-e2e-tests
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • (HEAD detached at 0.13.0) master
  • (HEAD detached at 0.14.3) main
  • (HEAD detached at kube2iam-3.2.0) main
  • 0.10.1
  • 0.10.10
  • 0.10.11
  • 0.10.2
  • 0.10.3
  • 0.10.4
  • 0.10.5
  • 0.10.6
  • 0.10.7
  • 0.10.7-rc2
  • 0.10.7-rc3
  • 0.10.8
  • 0.10.9
  • 0.11.1
  • 0.7.0
  • 0.8.0
  • 0.8.2
  • 0.9.1
  • 1.10-api
  • feat/add-pr-template
  • feat/chart-update-docker-image
  • feature/200-assumerole-error-cache
  • feature/5-increase-coverage-and-add-integration-and-e2e-tests
  • fix-ci
  • fix/sts-endpoint
  • gh-page-helm-chart
  • kube2iam-2.5.2
  • kube2iam-2.6.0
  • main
  • master
  • release-0.11.2
  • release-0.13.0
  • release-kube2iam-2.6.0

03 May 2026 09:46PM UTC coverage: 57.998% (+42.8%) from 15.208%
171

push

circleci

jtblin

test: add unit, integration, and E2E test infrastructure (closes #5)

Coverage grew from ~7.7% to 55% across all packages. All tests pass
with no changes to production behavior.

## Refactoring for testability

- iam/iam.go: extract IMDSClient interface over *imds.Client with
GetMetadata and GetIAMInfo methods; add IMDS field to iam.Client
for dependency injection; refactor GetInstanceId and doHealthcheck
to use the injected client
- iam/arn.go: add GetBaseArnWithClient(IMDSClient) accepting a mock;
GetBaseArn() delegates to it with the real client
- server: add iam and roleMapper fields to *Server so HTTP handlers
can receive injected mocks without interface proliferation

## Unit tests

iam/iam_test.go (+340 lines):
- AssumeRole: cache hit, external ID, STS error, region validation
- GetInstanceId: success and IMDS error paths
- GetHash, sessionName, GetEndpointFromRegion, GetIAMCode helpers

iam/arn_test.go (+130 lines):
- IsValidBaseARN, RoleARN, GetBaseArnWithClient with mock IMDS

k8s/k8s_test.go (new, +155 lines):
- PodByIP, NamespaceByName, ListPodIPs/Namespaces
- Duplicate IP handling (hostNetwork pods)
- Uses fake client-go Indexers; no live cluster required

server/server_test.go (new, +350 lines):
- parseRemoteAddr (table-driven, 6 cases)
- healthHandler: healthy and unhealthy (HealthcheckFailReason set)
- securityCredentialsHandler: role found, cross-account ARN, pod
not found
- roleHandler: match, mismatch (403), mapping error (404), STS
error (500)
- reverseProxyHandler: IMDSv2 PUT token, IMDSv2 GET with token,
standard GET (XFF header behavior)
- debugStoreHandler, doHealthcheck success/failure, NewServer
defaults

mappings/mapper_test.go (+115 lines):
- GetRoleMapping: no annotation + no default (error), with default
role, pod not found
- GetExternalIDMapping: with and without annotation
- DumpDebugInfo: key presence and role-by-IP value verification
- Extend storeMock to support configurable pods and namespaces

namespace_test.go (... (continued)

9 of 26 new or added lines in 2 files covered. (34.62%)

533 of 919 relevant lines covered (58.0%)

3.09 hits per line

Relevant lines Covered
Build:
Build:
919 RELEVANT LINES 533 COVERED LINES
3.09 HITS PER LINE
Source Files on master
  • Tree
  • List 10
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
171 feature/5-increase-coverage-and-add-integration-and-e2e-tests  test: add unit, integration, and E2E test infrastructure (closes #5) Coverage grew from ~7.7% to 55% across all packages. All tests pass with no changes to production behavior. ## Refactoring for testability - iam/iam.go: extract IMDSClient i... push 03 May 2026 09:51PM UTC jtblin circleci
58.0
170 feature/5-increase-coverage-and-add-integration-and-e2e-tests  test: add unit, integration, and E2E test infrastructure (closes #5) Coverage grew from ~7.7% to 55% across all packages. All tests pass with no changes to production behavior. ## Refactoring for testability - iam/iam.go: extract IMDSClient i... push 03 May 2026 09:15PM UTC jtblin circleci
58.0
169 feature/5-increase-coverage-and-add-integration-and-e2e-tests test: add unit, integration, and E2E test infrastructure (closes #5) Coverage grew from ~7.7% to 55% across all packages. All tests pass with no changes to production behavior. ## Refactoring for testability - iam/iam.go: extract IMDSClient int... push 02 May 2026 06:37AM UTC jtblin circleci
58.0
168 feature/5-increase-coverage-and-add-integration-and-e2e-tests test: add unit, integration, and E2E test infrastructure (closes #5) Coverage grew from ~7.7% to 55% across all packages. All tests pass with no changes to production behavior. ## Refactoring for testability - iam/iam.go: extract IMDSClient int... push 30 Apr 2026 01:35PM UTC jtblin circleci
58.0
167 feature/5-increase-coverage-and-add-integration-and-e2e-tests test: add unit, integration, and E2E test infrastructure (closes #5) Coverage grew from ~7.7% to 55% across all packages. All tests pass with no changes to production behavior. ## Refactoring for testability - iam/iam.go: extract IMDSClient int... push 30 Apr 2026 01:32PM UTC jtblin circleci
58.0
166 feature/5-increase-coverage-and-add-integration-and-e2e-tests test: add unit, integration, and E2E test infrastructure (closes #5) Coverage grew from ~7.7% to 55% across all packages. All tests pass with no changes to production behavior. ## Refactoring for testability - iam/iam.go: extract IMDSClient int... push 30 Apr 2026 01:28PM UTC jtblin circleci
58.0
165 feature/200-assumerole-error-cache Merge main and finalize AssumeRole error caching Pull #397 30 Apr 2026 01:43AM UTC jtblin circleci
16.94
163 main refactor: improve iam.Client testability with RegionClient and isolated caches push 30 Apr 2026 01:21AM UTC jtblin circleci
15.21
160 main refactor: make iam.Client testable and add baseline tests push 30 Apr 2026 01:06AM UTC jtblin circleci
14.33
159 main docs: add project-specific triage principles push 30 Apr 2026 12:56AM UTC jtblin circleci
8.07
See All Builds (313)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc