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

test: library integration tests #1725

Merged
merged 1 commit into from
Jun 12, 2024
Merged

test: library integration tests #1725

merged 1 commit into from
Jun 12, 2024

Conversation

vscaiceanu-1a
Copy link
Member

@vscaiceanu-1a vscaiceanu-1a commented Apr 26, 2024

Proposed change

Enhance the integration test campaign with tests for libraries.

  • @o3r/create should generate a project with a library
  • base Otter project should contain a library as well (along with an application)
  • check generated files by @o3r/workspace schematic for app and lib. Currently in create int tests, to be moved in workspace ones. feat(sdk): generate an sdk with spec from npm #1678 should be merged first.

Ensure test coverage for libs (similar to what we have for apps) and add assertions for app tests for:

Comment on lines 160 to 163
untouchedApp,
untouchedAppPath,
untouchedLib,
untouchedLibPath,
Copy link
Contributor

Choose a reason for hiding this comment

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

as far as I can tell we'll never have to make different check between untouchedApp and untouchedLib. We always want to check that they are untouched no matter the test
So I would suggest to simplify the tests to only export an array of paths to be checked as untouched
[untouchedAppPath, untouchedLibPath]

we could even consider writing a custom matcher to make it more readable
expect(gitDiff).not.toHaveTouched(path) or something

@github-actions github-actions bot added the bug Something isn't working label Jun 6, 2024
@vscaiceanu-1a vscaiceanu-1a force-pushed the feature/lib-it-tests branch 3 times, most recently from e720621 to a1a8d96 Compare June 6, 2024 14:13
fpaul-1A
fpaul-1A previously approved these changes Jun 6, 2024
fpaul-1A
fpaul-1A previously approved these changes Jun 7, 2024
mrednic-1A
mrednic-1A previously approved these changes Jun 7, 2024
@@ -116,7 +116,7 @@ describe('Create new sdk command', () => {
expect(() =>
packageManagerExec({
script: 'schematics',
args: ['@ama-sdk/schematics:typescript-core', '--spec-path', path.join(path.relative(sdkPackagePath, sdkFolderPath), 'swagger-spec.yml')]
args: ['@ama-sdk/schematics:typescript-core', '--spec-path', path.join(path.relative(sdkPackagePath, sdkFolderPath).split(path.sep).join(path.posix.sep), 'swagger-spec.yml')]
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure to understand this change because the path.join will retransform to \ on Windows.
Maybe you wanted to change it to path.posix.join as well

Copy link
Member Author

@vscaiceanu-1a vscaiceanu-1a Jun 11, 2024

Choose a reason for hiding this comment

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

I think I don't need .split(path.sep).join(path.posix.sep) at all here. Will remove it. It should be OS specific.

packages/@ama-sdk/create/src/index.it.spec.ts Show resolved Hide resolved
mrednic-1A
mrednic-1A previously approved these changes Jun 11, 2024
@vscaiceanu-1a vscaiceanu-1a added this pull request to the merge queue Jun 12, 2024
Merged via the queue into main with commit c9aa734 Jun 12, 2024
28 checks passed
@vscaiceanu-1a vscaiceanu-1a deleted the feature/lib-it-tests branch June 12, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment