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

test: Remove hardcoded test identities #2822

Merged

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #2821

Description

Removes the hardcoded test identities from our integration tests.

The current (develop) setup becomes impossible with source-hub ACP as the identity needs to include a signed bearer token containing the sourcehub address (not accessible during package init).

I also think this is a bit more maintainable.

This commit has been broken out of #2657 to minimize the risk of conflicts and to keep the PRs focused. It might be useful for reviewers to have a quick look at the full (WIP) getIdentity func in the original PR.

@AndrewSisley AndrewSisley added area/auth Related to the authorization and authentication of data area/testing Related to any test or testing suite code quality Related to improving code quality labels Jul 9, 2024
@AndrewSisley AndrewSisley added this to the DefraDB v0.13 milestone Jul 9, 2024
@AndrewSisley AndrewSisley requested a review from a team July 9, 2024 18:42
@AndrewSisley AndrewSisley self-assigned this Jul 9, 2024
@AndrewSisley AndrewSisley changed the title tests: Remove hardcoded test identities test: Remove hardcoded test identities Jul 9, 2024
Copy link

codecov bot commented Jul 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.97%. Comparing base (1acc084) to head (8d341fc).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2822      +/-   ##
===========================================
- Coverage    79.14%   78.97%   -0.17%     
===========================================
  Files          318      318              
  Lines        24162    24162              
===========================================
- Hits         19122    19081      -41     
- Misses        3663     3690      +27     
- Partials      1377     1391      +14     
Flag Coverage Δ
all-tests 78.97% <ø> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 16 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1acc084...8d341fc. Read the comment docs.

@AndrewSisley AndrewSisley force-pushed the 2821-rm-identities branch 2 times, most recently from cafd0f2 to 2436eaa Compare July 9, 2024 19:06
@@ -23,7 +25,7 @@ func TestACP_AddPolicy_BasicYAML_ValidPolicyID(t *testing.T) {

Actions: []any{
testUtils.AddPolicy{
Identity: actor1Identity,
Identity: immutable.Some(1),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why use index 1 if we never use index 0?

Copy link
Contributor Author

@AndrewSisley AndrewSisley Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think that hard about it :) actor*1*Identity => ID(1). I don't think this is important.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay that makes sense. I thought there might be something else I'm missing.

Copy link
Member

@nasdf nasdf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@AndrewSisley AndrewSisley merged commit 32092ac into sourcenetwork:develop Jul 9, 2024
38 of 39 checks passed
@AndrewSisley AndrewSisley deleted the 2821-rm-identities branch July 9, 2024 20:24
ChrisBQu pushed a commit to ChrisBQu/defradb that referenced this pull request Feb 21, 2025
## Relevant issue(s)

Resolves sourcenetwork#2821

## Description

Removes the hardcoded test identities from our integration tests.

The current (develop) setup becomes impossible with source-hub ACP as
the identity needs to include a signed bearer token containing the
sourcehub address (not accessible during package init).

I also think this is a bit more maintainable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/auth Related to the authorization and authentication of data area/testing Related to any test or testing suite code quality Related to improving code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove hardcoded test identities
2 participants