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

Is there a way to specify which project toml to use in tests? #1309

Closed
mistermoe opened this issue Apr 19, 2024 · 3 comments
Closed

Is there a way to specify which project toml to use in tests? #1309

mistermoe opened this issue Apr 19, 2024 · 3 comments
Assignees

Comments

@mistermoe
Copy link
Collaborator

secHandle := ftl.Secret[string]("some_secret").Get(ctx)

seems to read ftl-project.toml regardless of me setting the FTL_CONFIG environment variable

@github-actions github-actions bot added the triage Issue needs triaging label Apr 19, 2024
@alecthomas
Copy link
Collaborator

Work @matt2e is doing will solve this soon

@deniseli deniseli removed the triage Issue needs triaging label Apr 19, 2024
@matt2e
Copy link
Collaborator

matt2e commented Apr 21, 2024

@mistermoe I've been going down the path of making tests explicitly declare configs/secrets/DSNs (example code here: #1311 )
Is there anything in your use case that wouldn't fit into that pattern?

Edit: moved the example code here: #1317
It might not make it in as is, and instead go through some deeper rethinking. How it would work for your usecase is still helpful though.

alecthomas added a commit that referenced this issue Apr 26, 2024
Work around for #1309 until we get proper test support.
alecthomas added a commit that referenced this issue Apr 26, 2024
Work around for #1309 until we get proper test support.
@matt2e matt2e mentioned this issue May 3, 2024
10 tasks
@matt2e
Copy link
Collaborator

matt2e commented May 6, 2024

Solved in this PR: #1411
Example:

ctx := ftltest.Context(
  ftltest.WithProjectFile("path/to/ftl-project.toml"),
  ...
)

@matt2e matt2e closed this as completed May 6, 2024
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

No branches or pull requests

4 participants