Setup Initial PHP Unit Testing for License Protection

Registered by Alexander Sack

As part of the publishing solution provided on snapshots.linaro.org, the infrastructure team maintains a license protection script in PHP.

Currently, there is no testing in place. This blueprints aims to bringup initial tests and define the test bench and processes on how the unit tests get run. The delivery of this blueprint ensures that all unit tests can be run in a single command line after checking out the code. As a side delivery this work probably involves refactoring the codebase to allow clean unit testing.

The final goal would be to provide a setup for moving as much logic as possible away from the dothtacess file and into PHP.

Blueprint information

Status:
Complete
Approver:
Данило Шеган
Priority:
Medium
Drafter:
Stevan Radaković
Direction:
Approved
Assignee:
Stevan Radaković
Definition:
Approved
Series goal:
Accepted for trunk
Implementation:
Implemented
Milestone target:
milestone icon 2012.05
Started by
Stevan Radaković
Completed by
Stevan Radaković

Whiteboard

[asac, May 3, 2012] : put comments and status updates if no progress here...
[asac, May 3, 2012] : please massage description: should give brief context info (e.g. which greater effort is this part of), problem description that is tried to resolve and verbosely outline the approach to be taken.
[asac, May 3, 2012] : feel free to massage work items, headline and acceptance criteria: check with akgraner on best practices on how to write good headlines; acceptance criteria needs to be written so that the PM (dzin) can validate that the work was properly delivered. check with dzin to get an ack that he understands what to do with the acceptance. acceptance can be long and should convey what to expect for all the key parts touched.
[asac, May 3, 2012] : when done with editing and you are happy, please set definition to "review" and ping me, danilo and/or dzin for approving and putting on proper milestone target.
[stevanr, May 4, 2012] : Ready for review.
[stevanr, May 4, 2012] : First three work items are currently being worked on.
[stevanr, May 7, 2012]: Unit test cases recognized: https://pastebin.linaro.org/519/
[danilo, May 7, 2012]: Looks good.
[stevanr, May 9, 2012] : Merged code to trunk.
[stevanr, May 9, 2012] : Working on bug https://bugs.launchpad.net/linaro-license-protection/+bug/996002 in an effort to define a test plan later.
[stevanr, May 11, 2012] : Added new work item as per agreement with Danilo.
[stevanr, May 14, 2012]: Merged https://code.launchpad.net/~stevanr/linaro-license-protection/autorun-php-unittests to trunk.
[stevanr, May 17, 2012] Merged https://code.launchpad.net/~stevanr/linaro-license-protection/production-integration-tests into trunk. Production integration tests are in place.
[stevanr, May 17, 2012] Separated test plan from regular integration/unit tests.
[stevanr, May 17, 2012] Added rollout instructions for snapshots.l.o and releases.l.o in https://wiki.linaro.org/Platform/Infrastructure/infrastructure-knowledgebase

Meta:
Headline: The php code of the license-protection publishing feature is now unit tested, and the testing process has been documented.
Acceptance: License protection unit tests are defined, and can be run with a single command line. Also a process is in place that ensures that the unit tests get run on every merge and before rolling new code to production. Documentation of the process has been reviewed.

(?)

Work Items

Work items:
Setup license-protection code base to allow easy execution of unit tests: DONE
Identify unit test cases for license.php: DONE
Implement unit test cases for license.php: DONE
Refactor license.php code to succeed the unit tests: DONE
Define test plan to validate license protection works on production service: DONE
Merge and get changes accepted in the trunk code base: DONE
Roll out changes to license protection to production and validate license protection: DONE
Document unit testing and how it's done in a README.txt: DONE
Make sure the unit tests are executed as part of the integration testing: DONE

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.