Difference between revisions of "Test Integration"

From STRIDE Wiki
Jump to: navigation, search
Line 2: Line 2:
  
 
The starting point of this article assumes that your have completed the steps described in the article [[Test Integration]].
 
The starting point of this article assumes that your have completed the steps described in the article [[Test Integration]].
 +
 +
== Creating TestSpace Containers ==
 +
As a first step, we must create a project and test space into which our test results will be uploaded.
 +
 +
# Using your web browser, navigate to your company's testspace site and login<ref>Your testspace URL and login credentials are provided by S2 Technologies</ref>
 +
# Click on the "All Projects" tab, then click the "Create New Test Space" button at the bottom of the All Projects page.
 +
# Since we don't yet have a ''project'' created to act as a parent to the ''testspace'',
 +
## Scroll to the bottom or the ''New s2_test_space'' page and click the ''New Project...'' link.
 +
## In the ''add project'' box that appears, enter the Name as Stride Deployment, and Description as "sandbox for deployment tests".
 +
## Once the fields are entered, click the Create button in the add project box.
 +
# Back at the top of the New s2_test_space page, enter text as follows:
 +
#* Name: TestIntro
 +
#* Description: testintro sample tests
 +
#* Max results to keep: 10
 +
# If you would like to grant access to other users, check the appropriate boxes in the ''additional users''
 +
# For now, skip the ''auto compare'' options, you can change these (and other options) later if desired
 +
# In the Project list box, choose "Stride Deployment"
 +
# Finally, click the "create" button
 +
# On the subsequent page that is displayed, you will be able to manually upload results data, but leave the browser as it is, we will be automatically uploading results in a later step.
  
 
== Adding the TestIntro Tests to the Target Build ==
 
== Adding the TestIntro Tests to the Target Build ==
Line 25: Line 44:
 
-u
 
-u
 
--testspace [https://mycompany.stridetestspace.com@user:pwd]
 
--testspace [https://mycompany.stridetestspace.com@user:pwd]
--project stride_deployment
+
--project "Stride Deployment"
 
--space TestIntro
 
--space TestIntro
 
</pre>
 
</pre>
Line 31: Line 50:
 
  stride -O TestIntroOpts.txt
 
  stride -O TestIntroOpts.txt
  
 +
 +
<pre>
 +
Loading database...
 +
Connecting to device...
 +
  runtime version: 4.1.01
 +
Executing test units...
 +
  s2_testintro_cclass
 +
    > 1 passed, 1 failed, 0 in progress, 0 not in use.
 +
  s2_testintro_flist
 +
    > 2 passed, 1 failed, 0 in progress, 0 not in use.
 +
  s2_testintro_testdoubles
 +
    > 3 passed, 0 failed, 0 in progress, 0 not in use.
 +
  s2_testintro_testpoints
 +
    > 3 passed, 0 failed, 0 in progress, 0 not in use.
 +
Summary: 9 passed, 2 failed, 0 in progress, 0 not in use.
 +
Disconnecting from device...
 +
Saving result file...
 +
Uploading to test space...
 +
</pre>
 
== Viewing Results in TestSpace ==
 
== Viewing Results in TestSpace ==
  
Line 65: Line 103:
 
=== Use Namespacing to Organize Tests ===
 
=== Use Namespacing to Organize Tests ===
 
Over time, you will end up with lots of test units. Grouping these tests for display or running will become important as the count of test units grows. (You can see an example of C namespacing in the TestIntro tests.)
 
Over time, you will end up with lots of test units. Grouping these tests for display or running will become important as the count of test units grows. (You can see an example of C namespacing in the TestIntro tests.)
 
+
<hr/>
 +
== Notes ==
 +
<references/>
 
[[Category:Deployment]]
 
[[Category:Deployment]]

Revision as of 11:21, 10 June 2009

In this article, we discuss establishment of continuous integration testing using STRIDE.

The starting point of this article assumes that your have completed the steps described in the article Test Integration.

Creating TestSpace Containers

As a first step, we must create a project and test space into which our test results will be uploaded.

  1. Using your web browser, navigate to your company's testspace site and login[1]
  2. Click on the "All Projects" tab, then click the "Create New Test Space" button at the bottom of the All Projects page.
  3. Since we don't yet have a project created to act as a parent to the testspace,
    1. Scroll to the bottom or the New s2_test_space page and click the New Project... link.
    2. In the add project box that appears, enter the Name as Stride Deployment, and Description as "sandbox for deployment tests".
    3. Once the fields are entered, click the Create button in the add project box.
  4. Back at the top of the New s2_test_space page, enter text as follows:
    • Name: TestIntro
    • Description: testintro sample tests
    • Max results to keep: 10
  5. If you would like to grant access to other users, check the appropriate boxes in the additional users
  6. For now, skip the auto compare options, you can change these (and other options) later if desired
  7. In the Project list box, choose "Stride Deployment"
  8. Finally, click the "create" button
  9. On the subsequent page that is displayed, you will be able to manually upload results data, but leave the browser as it is, we will be automatically uploading results in a later step.

Adding the TestIntro Tests to the Target Build

Here we will add the TestIntro sample tests to the target build. We suggest that you continue to include the STRIDE diagnostics in this build and all subsequent builds.

Copy the file s2_testintro_test.h to a designated SCL_DIRS directory (or alternative), include the TestIntro source files in the compile/link and perform a target build.

Download the binary to the target and start it running.

Running and Publishing the TestIntro Tests

To execute the TestIntro tests, use a Windows or Linux host computer that has connectivity with the target system via your configured STRIDE transport (TCP/IP or seral). Additionally, make the generated STRIDE database (.sidb) visible to the host computer via a shared filesystem or a file copy to the host system.

If not already present, install the appropriate Host Tools package on the host computer.

We will now run stride with options instructing it to upload results to your TestSpace site. The command line gets rather long when all this is specified, so it's recommended that you create an options file to submit the command line options.

Create a text file named TestIntroOpts.txt and add the following text. You will need to fill in your particular argument values where brackets [ ] are shown.

-r /(*) 
--database [path]/stride.sidb 
--device [arg] 
-u
--testspace [https://mycompany.stridetestspace.com@user:pwd]
--project "Stride Deployment"
--space TestIntro
stride -O TestIntroOpts.txt


Loading database...
Connecting to device...
  runtime version: 4.1.01
Executing test units...
  s2_testintro_cclass
    > 1 passed, 1 failed, 0 in progress, 0 not in use.
  s2_testintro_flist
    > 2 passed, 1 failed, 0 in progress, 0 not in use.
  s2_testintro_testdoubles
    > 3 passed, 0 failed, 0 in progress, 0 not in use.
  s2_testintro_testpoints
    > 3 passed, 0 failed, 0 in progress, 0 not in use.
Summary: 9 passed, 2 failed, 0 in progress, 0 not in use.
Disconnecting from device...
Saving result file...
Uploading to test space...

Viewing Results in TestSpace

Next Steps

Automated Regression Testing

best to set things up so that you automatically

  • build,
  • load binaries on the hardware,
  • start target running,
  • run Stride tests
  • publish results to test space

Organizing Tests

put test results in suites

develop tests with namespace conventions

Publication of Test Results

Upload to test space

comparison with previously uploaded data

immediately see trends in

  • number of tests in each suite and overall

Best Practices

Use C++ Test Classes if Possible

If possible, use C++ Test Classes to write your test units. Test Classes offer extra features and are the easiest to use for programmers.

Use Namespacing to Organize Tests

Over time, you will end up with lots of test units. Grouping these tests for display or running will become important as the count of test units grows. (You can see an example of C namespacing in the TestIntro tests.)


Notes

  1. Your testspace URL and login credentials are provided by S2 Technologies