Navigation
Learn About
Developing With
Ingres Talk
Information
Toolbox
Views
Ingres SEP Scripting Best Practices
From Ingres Community Wiki
Jump to: navigation, search
Ingres SEP Scripting Best Practices
- Never do in one stage what you can do in many stages. Many short result canons are better than one long canon. Debugging problems will be easier.
- Never use a front-end tool when a command line tool exists. The canons are more manageable using command line tools within SEP. That is unless a front-end tool is what you are testing.
- Use built in commands in SEP whenever possible.
- Ensure the tests are portable.
- Use ignore canons <<~>> sparingly.
- Always include “order by” clauses when a select query pulls back more than one row.
- Create all tests as “testenv” and use “qasetuser ingres” to change ownership within a test.
- Do not write tests that will always diff, realize when unpredictable results will always occur and find another way.
- A test should not be dependent on other tests. It should be able to be run any number of times without DIFFING on subsequent runs. Clear up at the start of a test with SQL drop statements.
- Name database objects after the test. They should all be identifiable for where they came from to avoid trampling other tests or making it impossible to know what can be safely deleted.
- Use fill files for SQL statements sparingly if at all. Just fold the SQL statements into the test during the TM session so if anything goes wrong, you can see what is going on and what commands are being executed.
- Leave nothing behind, i.e. ensure any temporary files are cleaned up when the test completes. Compiling a program will create *.c, *.o, *.obj, *.exe so these need “delete” statements at the end of the test to clean them up. SEP will only automatically cleanup a file that was created as a “fill” file.
- Complete the header comments.
- Include a proper/current copyright statement.
- Use one of the predefined databases whenever possible.
- Use the SEPPARAMDB variable in the test.
- Use existing SEP tests and suites for guidance on how to write new tests. Avoid reinventing the wheel.
- Use data already in the database, i.e. system catalogs - when all that is needed is "some data" for a read-only test.
Retrieved from "http://community.actian.com/wiki/Ingres_SEP_Scripting_Best_Practices"

