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

Unit tests #607

Merged
merged 49 commits into from
Mar 25, 2021
Merged

Unit tests #607

merged 49 commits into from
Mar 25, 2021

Conversation

indam23
Copy link
Contributor

@indam23 indam23 commented Feb 4, 2021

  • Create unit tests for custom actions, focusing on external APIs
  • Closes add actions unit tests #535
  • Rename workflows more intuitively and add action unit testing to CI pipeline
    • remove mergepal - use automerge instead
    • add running unit tests
    • rename workflows & files for what they actually do

Base automatically changed from master to main February 11, 2021 09:34
@indam23 indam23 requested a review from erohmensing March 10, 2021 12:11
@indam23
Copy link
Contributor Author

indam23 commented Mar 10, 2021

@erohmensing not all actions are covered by these, but since it's getting to be a lot of changes already, I think we should get this mergeable and in before adding more. Wdyt?

@indam23 indam23 marked this pull request as ready for review March 10, 2021 12:12
@erohmensing
Copy link
Contributor

I agree, it makes sense to do it in phases, i'll take a look!

@indam23 indam23 marked this pull request as ready for review March 16, 2021 11:10
Copy link
Contributor

@erohmensing erohmensing left a comment

Choose a reason for hiding this comment

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

Great job with these! The fixtures are super thorough, i appreciate you giving time and thought to how to make these rerunnable without filling up our instance/newsletter with dummy conversations and such 😄
A few overall comments:

  • I think it makes sense to keep the functions for getting community events outside of the community event class (still under the same API though, where they currently are), as they aren't particular to specific event instances
  • Generally, consistency in the docstrings (uppercase vs lowercase, how the quotes are positioned

Coming back to review the tests themselves tomorrow -- mind blacking them in the meantime? Im so used to it now its faster to read 🙈

@RasaHQ RasaHQ deleted a comment from github-actions bot Mar 17, 2021
@erohmensing
Copy link
Contributor

A few comments got lost in the accodion btw -- about the domain getting reformatted

Copy link
Contributor

@erohmensing erohmensing left a comment

Choose a reason for hiding this comment

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

I'm stoked about these! but please also check the comments about the domain, I think it will break the forms as it is currently

@indam23
Copy link
Contributor Author

indam23 commented Mar 24, 2021

@erohmensing I know you already approved, but restructuring the tests to match the actions folder changed enough things that I think it needs another look


from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk import Tracker
from rasa.shared.core.domain import Domain
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want to use the rasa_sdk Domain here, which is already a dict

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is, but we want to load the actual domain of the bot - I started using an empty dict, but realized that could mask problems in the case that an action starts looking in the domain.

@indam23 indam23 merged commit 46c10b9 into main Mar 25, 2021
@indam23 indam23 deleted the unit_tests branch March 25, 2021 11:09
hamzaziizzz pushed a commit to hamzaziizzz/rasa-demo that referenced this pull request Aug 10, 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

Successfully merging this pull request may close these issues.

add actions unit tests
2 participants