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

Input to ServiceTestAssertLambda is updated to regular string #629

Merged
merged 7 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/little-turkeys-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@finos/legend-studio': patch
---

Fix a problem with escaping of single quote character which causes service tests created in Studio fail ([#586](See https://github.com/finos/legend-studio/issues/586)), this can be considered a workaround until we figure out a strategy for the discrepancies in mapping test and service test runners in `Engine` (see [finos/legend-engine#429](https://github.com/finos/legend-engine/issues/429))
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import {
tryToMinifyLosslessJSONString,
tryToFormatLosslessJSONString,
tryToFormatJSONString,
toGrammarString,
fromGrammarString,
createUrlStringFromData,
} from '@finos/legend-shared';
import type { EditorStore } from '../../../EditorStore';
Expand Down Expand Up @@ -136,7 +134,11 @@ export class TestContainerState {
this.testContainer.assert =
this.editorStore.graphManagerState.graphManager.HACKY_createServiceTestAssertLambda(
/* @MARKER: Workaround for https://github.com/finos/legend-studio/issues/68 */
toGrammarString(tryToMinifyLosslessJSONString(this.assertionData)),
// NOTE: due to discrepancies in the test runners for mapping and service, we have don't need
// to do any (un)escaping here like what we do for mapping test assertion data. For better context:
// See https://github.com/finos/legend-studio/issues/586
// See https://github.com/finos/legend-engine/issues/429
tryToMinifyLosslessJSONString(this.assertionData),
);
}
}
Expand All @@ -147,10 +149,12 @@ export class TestContainerState {
testContainter.assert,
);
this.assertionData = expectedResultAssertionString
? fromGrammarString(
/* @MARKER: Workaround for https://github.com/finos/legend-studio/issues/68 */
tryToFormatLosslessJSONString(expectedResultAssertionString),
)
? /* @MARKER: Workaround for https://github.com/finos/legend-studio/issues/68 */
// NOTE: due to discrepancies in the test runners for mapping and service, we have don't need
// to do any (un)escaping here like what we do for mapping test assertion data. For better context:
// See https://github.com/finos/legend-studio/issues/586
// See https://github.com/finos/legend-engine/issues/429
tryToFormatLosslessJSONString(expectedResultAssertionString)
: undefined;
}

Expand Down