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

Conversation tests using yaml #6457

Merged
merged 42 commits into from
Aug 27, 2020
Merged

Conversation tests using yaml #6457

merged 42 commits into from
Aug 27, 2020

Conversation

tmbo
Copy link
Member

@tmbo tmbo commented Aug 20, 2020

Proposed changes:

  • always ensure UserUttered events contain the full parse_data
  • renamed occurrences of conversation_tests.md to test_conversations.yml (as well as remaining nlu.md and story.md ones)
  • added default tests to rasa init in yaml format
  • removed the need to pass an interpreter to story readers (wasn't actually needed, e2e evaluation is done slightly different instead)
  • some code style improvements here and there 😅 (sorry for that, lead to an unexpected amount of changes)

Status (please check what you already did):

  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

@tmbo tmbo changed the title Conversation tests Conversation tests using yaml Aug 20, 2020
@tmbo tmbo requested a review from erohmensing August 24, 2020 15:32
@tmbo tmbo force-pushed the conversation-tests branch from 60d9e9e to ab208e5 Compare August 24, 2020 15:47
@tmbo
Copy link
Member Author

tmbo commented Aug 24, 2020

@erohmensing I've updated the documentation to reflect the changes to the story testing parts. Also updated the chitchat-faq's page along the way. (and some other smaller things I noticed in the docs). do you have time to review the docs changes?

rasa/core/events/__init__.py Show resolved Hide resolved
rasa/utils/plotting.py Show resolved Hide resolved
@tmbo tmbo requested a review from degiz August 24, 2020 16:19
@tmbo
Copy link
Member Author

tmbo commented Aug 24, 2020

@degiz this is ready for a code review, still need to add some tests but I think giving the code a review first helps speed this up.

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.

Awesome that you were able to pull out that interpreter from so much stuff 😄

docs/docs/chitchat-faqs.mdx Show resolved Hide resolved
docs/docs/command-line-interface.mdx Show resolved Hide resolved
docs/docs/testing-your-assistant.mdx Outdated Show resolved Hide resolved
docs/docs/training-data-format.mdx Show resolved Hide resolved
rasa/core/events/__init__.py Show resolved Hide resolved
rasa/core/test.py Show resolved Hide resolved
rasa/core/training/story_reader/markdown_story_reader.py Outdated Show resolved Hide resolved
rasa/core/training/story_reader/markdown_story_reader.py Outdated Show resolved Hide resolved
rasa/data.py Outdated Show resolved Hide resolved
@erohmensing
Copy link
Contributor

erohmensing commented Aug 24, 2020

Oops, I didn't see that you just wanted my review on docs changes, sorry 😅
But yes docs changes look good other than the couple of things i mentioned 👍 bless you for finding all those references to .md file names!

@tmbo
Copy link
Member Author

tmbo commented Aug 24, 2020

No worries, always also happy about any code comments 🙂

@tmbo tmbo mentioned this pull request Aug 25, 2020
5 tasks
Resolved issues in the following files via DeepSource Autofix:
1. rasa/cli/utils.py
@CLAassistant
Copy link

CLAassistant commented Aug 26, 2020

CLA assistant check
All committers have signed the CLA.

@tmbo tmbo added this to the 2.0a3 Rasa Open Source milestone Aug 26, 2020
Copy link
Contributor

@degiz degiz 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 refactoring! 🚀

One general note:
I thought we've using the test stories term now? Slack link.

So, for example, the name of the files would be failed_test_stories.yml, test_stories.yml, successful_stories.yml etc.

rasa/cli/data.py Outdated Show resolved Hide resolved
docs/docs/command-line-interface.mdx Outdated Show resolved Hide resolved
docs/docs/command-line-interface.mdx Show resolved Hide resolved
docs/docs/testing-your-assistant.mdx Outdated Show resolved Hide resolved
docs/docs/testing-your-assistant.mdx Outdated Show resolved Hide resolved
rasa/core/training/__init__.py Show resolved Hide resolved
rasa/core/training/interactive.py Outdated Show resolved Hide resolved
rasa/data.py Outdated Show resolved Hide resolved
rasa/data.py Show resolved Hide resolved
@tmbo
Copy link
Member Author

tmbo commented Aug 26, 2020

good point about the naming, I'll make sure it is test_stories everywhere instead of test conversations. I'll keep some occurrences in the docs page though for discoverability

@tmbo
Copy link
Member Author

tmbo commented Aug 26, 2020

@degiz addressed all the comments - still need an accept though 😉

Copy link
Contributor

@degiz degiz left a comment

Choose a reason for hiding this comment

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

Let's go 🚀 👍

@tmbo tmbo merged commit be509cf into master Aug 27, 2020
@tmbo tmbo deleted the conversation-tests branch August 27, 2020 10:36
@@ -135,8 +142,8 @@ def test_get_label_set(targets, exclude_label, expected):
assert set(expected) == set(actual)


async def test_interpreter_passed_to_agent(
Copy link
Contributor

Choose a reason for hiding this comment

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

@tmbo Why did you remove this test?

"""
raise NotImplementedError()

async def get_stories(
self,
interpreter: "NaturalLanguageInterpreter" = RegexInterpreter(),
Copy link
Contributor

Choose a reason for hiding this comment

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

We are changing an interface here which might be re-implemented by a community member. Can we please add a removal changelog?

indam23 pushed a commit that referenced this pull request Jul 27, 2022
* Create conversation_tests.yml

* implement conversation tests using the new yml format

* fixed linter issues

* renamed test_conversatiosn to stories

* fixed story reader detection

* fixed remaining tests

* fixed type error

* fixed some smaller style issues

* added documentation

* style improvements

* Update rasa/core/training/story_reader/markdown_story_reader.py

Co-authored-by: Ella Rohm-Ensing <[email protected]>

* adressed review comments (and linter error)

* added changelog item

* fixed failing tests

* added tests

* fixed linting

* fixed classification test

* fixed some more style errors deepsource found

* fixed some more deepsource issues

* fixed some more deepsource issues...

* Autofix issues in 1 files

Resolved issues in the following files via DeepSource Autofix:
1. rasa/cli/utils.py

* added comments for public funcionts

* trying to fix tests

* fixed server tests

* Apply suggestions from code review

Co-authored-by: Alexander Khizov <[email protected]>

* adressed review comments

* renamed files to stay in test stories naming convention

* removed trailing whitespace

* fixed shitty tests

* added default argument

* Update test_multi_project.py

* fixed windows errors

* trying to fix escaping issues

* fixed linter

Co-authored-by: Ella Rohm-Ensing <[email protected]>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Alexander Khizov <[email protected]>
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.

5 participants