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

[bugfix] Reduce amount of test data #378

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tavern/test_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/kcarretto/realm/tavern/internal/ent"
"github.com/kcarretto/realm/tavern/internal/ent/tag"
"github.com/kcarretto/realm/tavern/internal/namegen"
)

// createTestData populates the DB with some test data :)
Expand Down Expand Up @@ -183,7 +184,7 @@ func createTestData(ctx context.Context, client *ent.Client) {
SetQuest(printQuest).
SaveX(ctx)

for i := 0; i < 50; i++ {
for i := 0; i < 5; i++ {
createQuest(ctx, client, testBeacons...)
}
}
Expand Down Expand Up @@ -347,14 +348,14 @@ None
func createQuest(ctx context.Context, client *ent.Client, beacons ...*ent.Beacon) {
// Mid-Execution
testTome := client.Tome.Create().
SetName(newRandomIdentifier()).
SetName(namegen.GetRandomName()).
SetDescription("Print a message for fun!").
SetEldritch(`print(input_params['msg'])`).
SetParamDefs(`[{"name":"msg","label":"Message","type":"string","placeholder":"something to print"}]`).
SaveX(ctx)

q := client.Quest.Create().
SetName(newRandomIdentifier()).
SetName(namegen.GetRandomName()).
SetParameters(`{"msg":"Hello World!"}`).
SetTome(testTome).
SaveX(ctx)
Expand Down
Loading