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 script editing needs some updates to support coded tests #170

Closed
8 tasks done
johnpaliotta opened this issue Aug 8, 2024 · 3 comments · Fixed by #249
Closed
8 tasks done

Test script editing needs some updates to support coded tests #170

johnpaliotta opened this issue Aug 8, 2024 · 3 comments · Fixed by #249
Assignees

Comments

@johnpaliotta
Copy link
Contributor

johnpaliotta commented Aug 8, 2024

There are a few improvements needed - in the main branch

  • TEST.CODED_TEST_FILE should be added as a valid syntax in a .tst file (it should appear in the auto-complete list when you type in TEST., and not give an error when you type in)
    • What comes after the : will be a file path (this could be relative or absolute), but we do not want to do auto-completion on the filename (i.e., for TEST.CODED_TEST_FILE there is no autocomplete after :)
    • We probably need to make sure that coded tests are enabled in the environment/version of VectorCAST as well (they are not supported in 2023)
  • When the TEST.SUBPROGRAM is set to: coded_tests_driver
    • TEST.CODED_TEST_FILE should be allowed (that is, it should not give error diagnostics)
    • TEST.VALUE and TEST.EXPECTED lines should not be allowed (these should give error diagnostics)
    • Look for "Command is only valid" inside of the Python to see what kind of errors we already return
  • When the TEST.SUBPROGRAM is not set to: coded_tests_driver
    • TEST.CODED_TEST_FILE should not be allowed (i.e., it should now give an error diagnostic)
  • coded_tests_driver should not show up in the subprogram list for TEST.VALUE and TEST.EXPECTED lines
    • Normally when you type in TEST.VALUE:<unit>. you will get a list of all of the subprograms in <unit> -- DataAPI will tell you that coded_tests_driver is in <unit>, but we want to hide that from a user (the same for `TEST.EXPECTED)

Note:

  • In file tstCompletions.ts, comment: // TBD will need to change how this is done during the fix for issue #170
    • The way I get the completion for TEST.SUBPROGRAM is a little bit of a hack and will need to change
    • Currently, I send a fake TEST.VALUE:unit. line to get the list of subprograms
    • But currently, the Python strips coded_tests_driver in function: getFunctionList()
  • Need to check if coded_tests_driver should be allowed in TEST.SLOT lines
    • Does vcast support compounds with coded tests?
    • @Den1552 won't address this until Andrew is back
  • Look for all other uses of getFunctionList()
    • getFunctionList() is the "core" of the interaction between VS Code and VectorCAST, and is probably the place where coded_test_driver should be filtered, but not for TEST.SUBPROGRAM
@johnpaliotta
Copy link
Contributor Author

@aytey The first two items should be easy, the third one might be a little tricky, so let me know if Denis needs help

@aytey aytey assigned aytey and Den1552 and unassigned aytey Aug 8, 2024
@aytey aytey mentioned this issue Aug 12, 2024
3 tasks
@aytey
Copy link
Member

aytey commented Aug 14, 2024

Note: @johnpaliotta is going to remove coded_tests_driver from TEST.VALUE, TEST.EXPECTED and TEST.SUBPROGRAM (which will then allow the current tests to pass when coded mocks are turned on).

When we come to solve this case, we need to re-enable coded_tests_driver being a valid option for TEST.SUBPROGRAM.

@aytey
Copy link
Member

aytey commented Aug 29, 2024

Note: @johnpaliotta is going to remove coded_tests_driver from TEST.VALUE, TEST.EXPECTED and TEST.SUBPROGRAM (which will then allow the current tests to pass when coded mocks are turned on).

When we come to solve this case, we need to re-enable coded_tests_driver being a valid option for TEST.SUBPROGRAM.

@Den1552 this was done in this commit: da8f133

Den1552 added a commit that referenced this issue Dec 18, 2024
Zbigor pushed a commit that referenced this issue Jan 16, 2025
## Summary

Updates script editing to support coded tests and resolves #170. 

## Changed
- Updated the CI workflow to ensure the coverage report for version
`2024sp5` is uploaded to Codecov, replacing the previous version `2021`.

## Added
- **Syntax Support for `TEST.CODED_TEST_FILE`:**
  - Added `TEST.CODED_TEST_FILE` as a valid syntax in `.tst` files.
- Enabled auto-complete for `TEST.CODED_TEST_FILE` after typing `TEST.`.
  - Ensured no auto-completion for the file path after `:`.

- **Behavior When `TEST.SUBPROGRAM` is `coded_tests_driver`:**
  - Allowed `TEST.CODED_TEST_FILE` without error diagnostics.
- Disallowed `TEST.VALUE` and `TEST.EXPECTED` lines, ensuring they give
error diagnostics.

- **Behavior When `TEST.SUBPROGRAM` is Not `coded_tests_driver`:**
- Disallowed `TEST.CODED_TEST_FILE`, ensuring it gives an error
diagnostic.
- Removed `coded_tests_driver` from the subprogram list for `TEST.VALUE`
and `TEST.EXPECTED` lines.

- **Error Handling Enhancements:**
- Reviewed and ensured consistency in error messages related to these
changes.

- **Tests**
   - Added tests for new diagnostics

- **Autocompletion list for `TEST.SUBPROGRAM`** without using the fake
`TEST.VALUE` line
- In order to get the autocompletion list for `TEST.SUBPROGRAM`, we need
the `<unit>` from `TEST.UNIT`.
  - This is retrieved with `getNearest()` in `tstCompletion.ts`.
- This `<unit>` is sent as an additional parameter to the Python logic.
- In `processSubprogramLines()` (tstUtilities.py), we use this `<unit>`
to retrieve, with `getFunctions()`, the `autocompletion` list of all the
functions in this unit from the `DataAPI`.
- At the end, we add SUBPROGRAM-specific autocompletions like `<<INIT>>,
<<COMPOUND>>, <<coded_tests_driver>>`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants