Skip to content

Add RPGUnit test case and test suite generation #382

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

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

Conversation

SanjulaGanepola
Copy link
Member

@SanjulaGanepola SanjulaGanepola commented May 13, 2025

Changes

Add RPGUnit test case and test suite generation

image

TODO:

  • Handle all types
  • Handle nested structs
  • Handle when test file exists and test case is generated
  • Can we not generate prototypes if they already exist?

Checklist

  • have tested my change
  • have added myself to the contributors' list in the README

worksofliam and others added 5 commits May 7, 2025 14:50
Signed-off-by: Sanjula Ganepola <[email protected]>
Signed-off-by: Sanjula Ganepola <[email protected]>
Signed-off-by: Sanjula Ganepola <[email protected]>
@worksofliam worksofliam self-assigned this May 13, 2025
@worksofliam
Copy link
Contributor

Liam to move getReturns into parser and write test cases for it.

SanjulaGanepola and others added 6 commits May 14, 2025 09:36
Signed-off-by: Sanjula Ganepola <[email protected]>
Signed-off-by: Sanjula Ganepola <[email protected]>
…julaGanepola/vscode-rpgle into pr/SanjulaGanepola/382
Signed-off-by: Sanjula Ganepola <[email protected]>
worksofliam and others added 4 commits May 14, 2025 13:50
erge branch 'feature/rpgunit-test-case-generation' of https://github.com/SanjulaGanepola/vscode-rpgle into feature/rpgunit-test-case-generation
Signed-off-by: Sanjula Ganepola <[email protected]>
Signed-off-by: Sanjula Ganepola <[email protected]>
@SanjulaGanepola SanjulaGanepola marked this pull request as ready for review May 16, 2025 17:10
@SanjulaGanepola
Copy link
Member Author

Got it working with most of the common types. Generates a test that passes!

I'm going to add a bunch of new tests to verify all the APIs I added here work properly. I will do this outside this PR so we can at least still get this in. This is ready for review. Could we get a release out once it is merged?

image

@worksofliam worksofliam self-requested a review May 18, 2025 19:55
@worksofliam
Copy link
Contributor

@SanjulaGanepola I am looking but codeActions.ts has a lot of conflicts. I think it might be worth you looking at this so I am not to break anything.

Signed-off-by: Sanjula Ganepola <[email protected]>
@SanjulaGanepola
Copy link
Member Author

@worksofliam Conflicts gone. Ready for review

Copy link
Contributor

@worksofliam worksofliam left a comment

Choose a reason for hiding this comment

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

Really a simple change. I would like this to generate POSIX paths with single quotes around it.

...prototypes,
``,
`/include qinclude,TESTCASE`,
...uniqueIncludes,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think some logic needs to happen for uniqueIncludes.

If uniqueInclude is a POSIX path (IFS/local), then please use single quotes around the /copy//include path:

/include 'qrpgleref/empdet.rpgleinc'

And to confirm, members should use this format:

/include qrpgleref,empdet

Copy link
Member Author

Choose a reason for hiding this comment

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

I update the PR to add single quotes. In general, test case generation for members and even IFS files won't work yet given how the file creation is currently implemented. Thus, I haven't made the change to fix the includes for members. I added it to this TODO list (#383) so I can make that change outside this PR.

@worksofliam
Copy link
Contributor

@SanjulaGanepola Just additional non-requirement for this PR: there are a lot of new functions for this test action in codeActions.ts. Perhaps down the line we should put all the 'create test' specifics into a unique file.

Signed-off-by: Sanjula Ganepola <[email protected]>
@SanjulaGanepola
Copy link
Member Author

Perhaps down the line we should put all the 'create test' specifics into a unique file.

@worksofliam Yes I agree. Added to the TODO list!

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