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

chore(tests): print more errors when snapshot tests fail #5839

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

pajlada
Copy link
Member

@pajlada pajlada commented Jan 19, 2025

No description provided.

Copy link
Member Author

@pajlada pajlada left a comment

Choose a reason for hiding this comment

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

image

@pajlada pajlada added the ci Issues related to the ci label Jan 19, 2025
@pajlada pajlada enabled auto-merge (squash) January 19, 2025 15:49
ASSERT_TRUE(snapshot->run(got, UPDATE_SNAPSHOTS));
ASSERT_TRUE(snapshot->run(got, UPDATE_SNAPSHOTS))
<< "Snapshot " << snapshot->name() << " failed. Expected JSON to be\n"
<< QJsonDocument::fromVariant(snapshot->output().toVariant()).toJson()
Copy link
Contributor

Choose a reason for hiding this comment

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

fromVariant can only create objects or arrays.
This should be something like

QString debugRepr(const auto& it) {
    QString str;
    QDebug dbg(&str);
    dbg << it;
    return str;
}

Qt 6.9 will allow QJsonValue.toJson().

@pajlada pajlada merged commit 58748d0 into master Jan 19, 2025
19 of 20 checks passed
@pajlada pajlada deleted the chore/more-errors-in-snapshot-tests branch January 19, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Issues related to the ci
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants