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

Provide an example of tests/testdata usage in bats tests #68

Open
MurzNN opened this issue Dec 5, 2024 · 1 comment
Open

Provide an example of tests/testdata usage in bats tests #68

MurzNN opened this issue Dec 5, 2024 · 1 comment

Comments

@MurzNN
Copy link
Contributor

MurzNN commented Dec 5, 2024

To improve the test coverage, I need to use some assets from files inside the ddev project, but have a hard time understanding how to do this right.

I need to run a command inside the testing ddev project like this:

  ddev exec "curl -X POST -H "Content-Type: application/json" -d @[some_dir]/testdata/test-metric.json http://opentelemetry-grafana:4318/v1/metrics"

So, to make the files available inside the testing ddev project, I have to list them in the install.yaml that looks not so good.

So, could you please provide an example of the usage of test asset files from the testdata directory? Thanks!

@rfay
Copy link
Member

rfay commented Dec 5, 2024

Hi @MurzNN - Please take a look at ddev-platformsh, which uses lots of stuff in testdata, https://github.com/ddev/ddev-platformsh/tree/main/tests

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

2 participants