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

Kind integration feature #71

Merged
merged 3 commits into from
May 5, 2023
Merged

Kind integration feature #71

merged 3 commits into from
May 5, 2023

Conversation

jbr
Copy link
Contributor

@jbr jbr commented May 3, 2023

based on #67 no longer based on #67

@jbr jbr requested a review from a team as a code owner May 3, 2023 20:56
Copy link
Contributor

@tgeoghegan tgeoghegan left a comment

Choose a reason for hiding this comment

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

Just one bikeshed-y thing but I'm happy with how small this change is!

Cargo.toml Outdated
@@ -8,6 +8,7 @@ default-run = "divviup_api_bin"
[features]
default = []
aggregator-api-mock = []
kind-integration = []
Copy link
Contributor

Choose a reason for hiding this comment

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

"Running it in Kind" is a shorthand for what we (Divvi Up) would use this for, but I think we should name this so it better captures what it does. How about stub-api-integrations?

Copy link
Contributor Author

@jbr jbr May 3, 2023

Choose a reason for hiding this comment

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

This doesn't actually stub api integrations, though. It's more like "integration test mode" — the http clients are still configured to talk to the external internet, we just don't add a queue job to do any of those interactions

@tgeoghegan
Copy link
Contributor

With this change, I can run divviup-api as cargo run --features aggregator-api-mock,kind-integration and then:

> curl -s -H "Accept: application/vnd.divviup+json;version=0.1" localhost:8080/api/users/me | python -m json.tool
{
    "email": "kind@test.example",
    "email_verified": true,
    "name": "kind user",
    "nickname": "kind",
    "picture": null,
    "sub": "",
    "updated_at": "+002023-05-02T21:51:35.913540658Z",
    "admin": false
}

👍🏻 works like a charm!

@jbr jbr force-pushed the kind-integration-feature branch from b573743 to db08b67 Compare May 3, 2023 21:59
@jbr
Copy link
Contributor Author

jbr commented May 3, 2023

With this change, I can run divviup-api as cargo run --features aggregator-api-mock,kind-integration and then:

> curl -s -H "Accept: application/vnd.divviup+json;version=0.1" localhost:8080/api/users/me | python -m json.tool
{
    "email": "kind@test.example",
    "email_verified": true,
    "name": "kind user",
    "nickname": "kind",
    "picture": null,
    "sub": "",
    "updated_at": "+002023-05-02T21:51:35.913540658Z",
    "admin": false
}

👍🏻 works like a charm!

We could also drop the content-type and accept requirements with this feature to make things more concise

@tgeoghegan
Copy link
Contributor

We could also drop the content-type and accept requirements with this feature to make things more concise

I don't think that's necessary. Whatever client we use to hit the divviup-api API in the integration test is perfectly capable of handling those headers correctly.

@tgeoghegan tgeoghegan mentioned this pull request May 4, 2023
@tgeoghegan
Copy link
Contributor

@jbr Should we take this change today? It'd unblock some work (#72, https://github.com/divviup/janus-ops/pull/689) that I'd like to land before I go on vacation next week.

@jbr jbr merged commit 9257d06 into main May 5, 2023
@jbr jbr deleted the kind-integration-feature branch May 5, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants