I’ve been working on a new XBlock and I have it working when installed into LMS / CMS. However, I’m getting hung up on how to create good unit tests for the XBlock views (e.g. student_view).
The only example I’ve been able to find that actually unit-tests views is edx-ora2, but this is somehow able to import workbench and scenario and other helpers from the xblock-sdk that I am unable to get set up for this XBlock. (Consistently running into the no module found "Workbench" error when I try to do any reference here in my tests, even after installing xblock-sdk dependency.
Any tips / resources would be amazing, I’m definitely getting stuck here.
Both of these repos use GitHub Actions CI so you should definitely be able to use one of those approaches for any new XBlocks.
In the future, I think a much better approach is needed, either by being able to test XBlocks simply by installing XBlock + Learning Core, or by migrating to a successor to XBlocks that has a much more well-defined API and test infrastructure.