How to test code

Hi there, I’m brand new to this and just learned about this great tool! I wanted to ask if it was possible to leverage the testing tool to test code snippets via a CI check in a PR to ensure the main eng code (which is in another repo) is accurate? We use docusaurus and I’m not sure how to use this to test the code against the codebase? (Would it be installing nbdev and then creating a github action to run nbdev_test? How would it know what to test?)

Thank you in advance for any guidance :pray:

Please clarify both CI and PR.

Hi @Conwyn, thanks for your reply and sorry for being unclear!

So we open documentation PRs in our open source docs repo to document developer docs. the actual developer code, however, is in another open-source repository.

How can i use nbdev to run CI checks on all the code sippets in the documentation to make sure they’re still valid. If it’s possibly, presumably this CI check would run for every PR opened against the respective code snippet? And would it be configured via a github action?

Apologies if i’m confusing you but I’m trying to understand how to use this tool as I was told it can be helpful to test code snippets for documentation before merging a pr.

Maybe there’s a way to do this via github actions?

@Mirna I’m not experienced in working with nbdev but based on this tutorial in their documentation it seems like the nb_new command will setup some of the basics around GitHub actions.

1 Like

Hi Mirna

To clarify my question.
What do the letters CI and PR mean. It helps if you ask a question to qualify any abbreviations you use. I assume it is not continuous improvement and public relations. We are a wide forum so we all use different terms often to describe similar concepts.

Regards Conwyn

Oh sorry, yes! By ‘CI’ I mean continuous integration (part of the continuous integration/continuous deployment software engineering principles). And by ‘PR’, I mean a version control pull request.