GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Internal variable that stores test case name · Issue #781 · utPLSQL/utPLSQL

Internal variable that stores test case name #781

New issue
Copy link
New issue
Copy link
Closed
#963
Closed
Internal variable that stores test case name#781
#963
Copy link
Labels
enhancement

Description

@MS-24
MS-24
opened on Nov 9, 2018
Issue body actions

Hi there ,

I would like to if there is any internal variable that stores the test case name in it , so that I could use this in my --%beforetest annotation , to handle input data.

Thanks!!

Activity

  1. lwasylow
    added
    discussion
    on Nov 9, 2018
  2. lwasylow commented on Nov 9, 2018

    @lwasylow
    lwasylow
    on Nov 9, 2018
    Member
    More actions

    Hi
    Can you clarify what you mean ?
    If you could let us know what at are your trying to achieve , so sample scenario/ mockup ?

  3. MS-24 commented on Nov 9, 2018

    @MS-24
    MS-24
    on Nov 9, 2018
    Author
    More actions

    Hi @lwasylow ,
    This is related to data setup.
    For my test scenario , I need to insert rows in 20 tables. My approach is

    1. Create external tables for each of the table for the first time and store the data in it and use it each time the test runs . This is kind of one time setup for that test case.
      for example for the original table employee , I will create an external table as tst_employee using "orgnization external" .
     Create table tst_employee
        organization external
        ( type oracle_datapump
        default directory TEST_LOG
        location ('tst_employee.dmp' )
        ) as select *  from employee where customer_ref= 'tst_bv_spend_cap'.
    
    1. Store this tst_employee.dmp file in a directory called 'test_case_name' in unix.
      3.Likewise if there are 10 test cases I would like to create 10 tst_employee.dmp files with relevant to each of the test cases and keep in each of those directories.
    2. With this my data creation part is done. Now I will clear all the data from original tables . i.e delete from employee.
    3. When I ran my test case , as part of --%beforetest , I am calling my data_setup procedure , in which I am planning to use'insert into employee select * from tst_employee'to populate the data in employee so that my original code to be test would use.
    4. Now I have 10 unix directories in which 10 different data setup files are present which will be used by 10 different test cases.
      7.For each test case I will copy the relevant file .dmp file to a directory called working directory and will remove once the test is completed .
    5. As my test_case_name and unix directory name are same here I am planning to use the test_case_name in a script to copy the file from test case unix directory to working directory. In this way I don't have to create multiple all_directory entries .
    6. As my data_setup procedure doesn't know which test currently being executed (or does it know?) it is difficult to achieve the above copying files to working directory. So , if there is any internal variable that stores the test_case_name which is available in data_setup procedure , it would be handy.

    Hope my explanation is clear . Please suggest.

  4. lwasylow commented on Nov 9, 2018

    @lwasylow
    lwasylow
    on Nov 9, 2018
    Member
    More actions

    I don't think we support functions with parameters as part of before or after at the moment.
    What I would suggest as workaround is to create a one procedure that accepts filename and create it.
    And then for each test create a wrapper procedure without parameter but with hardcoded file name.

    As for your request this is something that have to be looked and investigated a bit further in terms of impact and feasibility.

  5. MS-24 commented on Nov 10, 2018

    @MS-24
    MS-24
    on Nov 10, 2018
    Author
    More actions

    Ok ,Thank you

  6. jgebal commented on Nov 28, 2018

    @jgebal
    jgebal
    on Nov 28, 2018
    Member
    More actions

    I see two options, probably both would be useful.

    • We could improve the way we use dbms_application_info
    • We could create a dedicated utPLSQL session context that would be able to hold important information durong test execution.

    The more i think about it the more i like it. 😀

  7. lwasylow commented on Nov 28, 2018

    @lwasylow
    lwasylow
    on Nov 28, 2018
    Member
    More actions

    Application info is restricted to 30 char, not sure if that would be enough.

  8. Shoelace commented on Dec 3, 2018

    @Shoelace
    Shoelace
    on Dec 3, 2018
    Member
    More actions

    i think a session context is a good idea.. application_inof/module/action can be overwritten by the procedure under test anyway

  9. jgebal
    added
    enhancement
    on Jul 2, 2019
  10. jgebal
    added 2 commits that reference this issue on Jul 2, 2019

    [WIP] Ability to run expectations without test

    This issue will close once commit e172d40 is merged into the 'develop' branch.
    e172d40

    [WIP] Ability to run expectations without test

    This issue will close once commit f5fa468 is merged into the 'develop' branch.
    f5fa468
  11. jgebal
    removed
    discussion
    on Jul 4, 2019
  12. jgebal
    closed this as completedin #963on Jul 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.