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

UI-6384 - Test the CLI #4

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

antoinetissier
Copy link
Collaborator

🧪

Copy link
Collaborator

@Nouzbe Nouzbe left a comment

Choose a reason for hiding this comment

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

The test looks good, but I am wondering about the best approach for this. I think it is out of the scope of this PR, as similar tests already existed in this repo.

My concern is huge snapshots, and in particular with parts of JSON objects being stringified and inlined (the content of CS entries representing dashboards). My concern is that it is so hard to read that I believe developers will never care about snapshot changes. Maybe the most thorough ones will just pay attention to the fact that they changed in case they did not expect it, but not to the actual change. And even this, I believe that the majority of developers will not even do it to be honest.

That being said, it is good to have some tests checking the input/output of the CLI and I don't think this is debatable.

Maybe the best option would be to serialize snapshots in a better way, in particular at least to avoid inlining the dashboard states.

What do you think?

@Nouzbe Nouzbe assigned antoinetissier and unassigned Nouzbe Oct 27, 2021
@antoinetissier
Copy link
Collaborator Author

antoinetissier commented Oct 27, 2021

I agree, I'm not a fan of huge snapshots either.

We could decide that the more atomic unit tests should be enough, and that in the CLI test we should just test that there are no errors being thrown.

But if we want to keep testing the output, I don't really see a way around the huge snapshot here.
As you said, indeed an improvement could be to recursively JSON.parse() the content of the entries (the top level is already nice, but we could go further to make the MDX more readable for example).

@github-actions
Copy link
Contributor

Cannot auto-update because of conflicts.

@Nouzbe
Copy link
Collaborator

Nouzbe commented Mar 24, 2022

I am in favor of keeping the big snapshots for now and moving this discussion to a later time.

Other than that the PR looks good. Can you rebase it?

Also, I noticed that tests are broken on master. We should add a CI to this repo. Could you open a ticket to track it?

@Nouzbe Nouzbe assigned antoinetissier and unassigned Nouzbe Mar 24, 2022
@antoinetissier
Copy link
Collaborator Author

I am in favor of keeping the big snapshots for now and moving this discussion to a later time.

Other than that the PR looks good. Can you rebase it?

Also, I noticed that tests are broken on master. We should add a CI to this repo. Could you open a ticket to track it?

https://support.activeviam.com/jira/browse/UI-7162

@antoinetissier antoinetissier force-pushed the personal/a.tissier/UI-6384-test-cli branch from 9e04b49 to 8bd541f Compare April 5, 2022 15:56
@github-actions
Copy link
Contributor

Cannot auto-update because of conflicts.

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.

2 participants