Skip to content

How to populate Unit test results in the tables #541

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

Closed
nrkmca opened this issue Dec 26, 2017 · 10 comments
Closed

How to populate Unit test results in the tables #541

nrkmca opened this issue Dec 26, 2017 · 10 comments

Comments

@nrkmca
Copy link

nrkmca commented Dec 26, 2017

Hi,
Can you please let me know how to populate the test results in to existing tables?

  1. Each unit run will have unique number or ID
  2. Test status is failed or passed: Getting in the Oracle output but not storing in anywhere
  3. I would like to pass actual and expected queries from other table (how can do?)
  4. I need full test case information/history like test_id(unique), test_status(P/F), execution_date, Expected result, actual result etc. I need this info in the table it self.

Can you please help for above requirement?

@Shoelace
Copy link
Member

same as #535 . i am working on a solution but i dont know if/when it'll be finished

@jgebal
Copy link
Member

jgebal commented Dec 29, 2017

@nrkmca , @Shoelace
I have a strong doubt about value of populating test results int database tables.
What is it that you're trying to achieve by this?
Storing data in tables is not a solution by itself - it's a mean to provide some solution.

What is it the problem statement, that you want to solve with this?

My concerns are:

  • storing results in table makes test results bound to single database. You can't easily gather results from 2,10,100 databases.
  • storing results bring maintenance burden as the results tables need to be purged/maintained somehow
  • tables would need to become Public API as we do not want engineers to get tightly coupled with utPLSQL internals.
  • once tables are part of public API, it will be hard to change them as the framework changes
  • data in tables provides no value by itself, you need some reporting, analysis on top of it. Those are already provided by CI/CD servers like Jenkins as well as Sonar.

@Pazus
Copy link
Member

Pazus commented Dec 30, 2017

Let me join @jgebal on that. We discussed this topic multiple times and we came to exactly this conclusion. The database is the wrong place to store the history of test execution, it means the database becomes Stateful and it has different state on each run. Also you need to associate additional info with the run which is not available at the DB level, Git SHA-1 for example.
But the more important is that you need a separate additional tool to consume the results, to track it. For years the whole development community uses CI/CD tools for such things, delegating storing all the context and results of build and tracking history of changes.

@Shoelace
Copy link
Member

Shoelace commented Jan 1, 2018

yes i know and i agree.. i remember the discussions..
it does not belong as part of the main utplsql framework, however in my particular case at least it is going to be used as an interim step in replacing an existing custombuilt unit test framework.

so for me the problem statement is:
how do i seamlessly integrate utplsql into an existing larger custombuilt ecosystem? (that relies on results stored in a table)

Ideally all of the surrounding guff will be replaced also. but as with a lot of businesses it requires taking baby-steps.

@nrkmca
Copy link
Author

nrkmca commented Jan 2, 2018

Hi @jgebal, @Shoelace, @Pazus,
We are using one database with utPLSQL framework.
My requirement is to store the test case information in the existing tables like PLSQL_PROFILER_DATA/PLSQL_PROFILER_RUNs. Actually, I created 2 reusable quires one for actual result and other one for expected result. I will change the queries based on my test scenarios and capture output data in to 2 cursors. I need unique RUN_ID, USER_ID, Test Results (PASS/FAIL), TEST date and TIME will be populated in the tables. later, I will take this info for further steps. This will be useful for us to automate the process. Please check and help on this.

@jgebal
Copy link
Member

jgebal commented Jan 2, 2018

@nrkmca - are you working for the same company as I am?

@jgebal
Copy link
Member

jgebal commented Jan 2, 2018

@nrkmca PLSQL_PROFILER_DATA was never populated by utPLSQL v2 so it's hard to say it's an existing table from utPLSQL point of view - PLSQL_PROFILER_DATA is part of Oracle's DBMS_PROFILER.

Did you look into utPLSQL v3 code coverage? If you read the doc , you'll find how to make use of utPLSQL v3 code coverage. v3 uses DBMS_PROFILER as wee and PLSQL_PROFILER_DATA gets populated when you run utPLSQL with coverage.

@nrkmca
Copy link
Author

nrkmca commented Jan 9, 2018

Thank you Jgebal. I ran utPLSQL with coverage and able to populate the test case related information in the tables. I need little bit more information like unique run_id and test result in PLSQL_PROFILER_DATA/PLSQL_PROFILER_RUNs. but, You are saying which is not possible :-).

@jgebal
Copy link
Member

jgebal commented Jan 9, 2018

utPLSQL v2 didn't have code coverage built into it. You must be using custom solution.
V3 gives coverage in many formats

@pesse
Copy link
Member

pesse commented Mar 8, 2018

Possible with custom reporter
Closed via #589

@pesse pesse closed this as completed Mar 8, 2018
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

No branches or pull requests

5 participants