Skip to content

Commit f02a633

Browse files
Merge branch 'master' into vitals-audit
2 parents d171d19 + d475eae commit f02a633

File tree

114 files changed

+4380
-743
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+4380
-743
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#Created by .ignore support plugin (hsz.mobi)
22

33
package/releases
4+
package/vendor
45

56

67
### Eclipse template

.travis.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,47 +30,50 @@ jobs:
3030
services:
3131
- docker
3232
env:
33-
- SUGAR_VERSION=8.0 SUGAR_EDITION=Ent
33+
- SUGAR_VERSION=8.3 SUGAR_EDITION=Ent
3434
before_script:
3535
- cd package
3636
- composer install
3737
- "./pack.php -v $(date +'%Y%m%d-%H.%M.%S')"
3838
- cd ../scripts
3939
- sudo service mysql stop
4040
script:
41-
- ./SetupEnvAndRunTests.sh $SUGARCRM_USERNAME $SUGARCRM_PASSWORD $SUGAR_VERSION $SUGAR_EDITION $GITHUB_USERNAME $GITHUB_PASSWORD workspace/sugardocker
41+
- "./SetupEnvAndRunTests.sh $SUGARCRM_USERNAME $SUGARCRM_PASSWORD $SUGAR_VERSION
42+
$SUGAR_EDITION $GITHUB_USERNAME $GITHUB_PASSWORD workspace/sugardocker"
4243
- stage: Run Tests
4344
sudo: required
4445
language: php
4546
php: '7.1'
4647
services:
4748
- docker
4849
env:
49-
- SUGAR_VERSION=8.0 SUGAR_EDITION=Pro
50+
- SUGAR_VERSION=8.3 SUGAR_EDITION=Pro
5051
before_script:
5152
- cd package
5253
- composer install
5354
- "./pack.php -v $(date +'%Y%m%d-%H.%M.%S')"
5455
- cd ../scripts
5556
- sudo service mysql stop
5657
script:
57-
- ./SetupEnvAndRunTests.sh $SUGARCRM_USERNAME $SUGARCRM_PASSWORD $SUGAR_VERSION $SUGAR_EDITION $GITHUB_USERNAME $GITHUB_PASSWORD workspace/sugardocker
58+
- "./SetupEnvAndRunTests.sh $SUGARCRM_USERNAME $SUGARCRM_PASSWORD $SUGAR_VERSION
59+
$SUGAR_EDITION $GITHUB_USERNAME $GITHUB_PASSWORD workspace/sugardocker"
5860
- stage: Run Tests
5961
sudo: required
6062
language: php
6163
php: '7.1'
6264
services:
6365
- docker
6466
env:
65-
- SUGAR_VERSION=8.0 SUGAR_EDITION=Ult
67+
- SUGAR_VERSION=8.3 SUGAR_EDITION=Ult
6668
before_script:
6769
- cd package
6870
- composer install
6971
- "./pack.php -v $(date +'%Y%m%d-%H.%M.%S')"
7072
- cd ../scripts
7173
- sudo service mysql stop
7274
script:
73-
- ./SetupEnvAndRunTests.sh $SUGARCRM_USERNAME $SUGARCRM_PASSWORD $SUGAR_VERSION $SUGAR_EDITION $GITHUB_USERNAME $GITHUB_PASSWORD workspace/sugardocker
75+
- "./SetupEnvAndRunTests.sh $SUGARCRM_USERNAME $SUGARCRM_PASSWORD $SUGAR_VERSION
76+
$SUGAR_EDITION $GITHUB_USERNAME $GITHUB_PASSWORD workspace/sugardocker"
7477
- stage: Build & Post on GitHub
7578
language: php
7679
php: '7.1'
@@ -79,12 +82,13 @@ jobs:
7982
- composer install
8083
script:
8184
- "./pack.php -v $(date +'%Y%m%d-%H.%M.%S')"
82-
- "./pack.php -v $(date +'%Y%m%d-%H.%M.%S') -w 40" #Using 40 as a typical path length. May not work for all Windows installations
85+
- "./pack.php -v $(date +'%Y%m%d-%H.%M.%S') -w 40"
86+
- "./pack.php -v $(date +'%Y%m%d-%H.%M.%S') -p"
8387
before_deploy: git tag "$(date +'%Y%m%d-%H.%M.%S')-$(git log --format=%h -1)"
8488
deploy:
85-
file_glob: true
8689
provider: releases
87-
file: releases/sugarcrm-ProfessorM-*.zip
8890
api_key:
89-
secure: wZjieCCyLewnTuR1vLjtVLp+ANtaq2ltP6kyiBcE33j2WyyWIiQqHtmjWAnnpq3Kkz64Pe1epfWuFJagXQyMvH9ACojmk0bZ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SIs09+vFvkAkyXM7w8+eUiXIXdlic9wA6/xyELN0B6szOjy3SGO0CUaVH9RjkB0v4nF04I9FcUG4eHandCDs6sZFqf+0KgCoMFXK7lhfkNrI+14Re3z3BRt+209nT+kKZ1WGV/31Sc3lZJ08xubVasv9onMQ8EqKu3t3Ep/pNER0Z8Hr/fXJb9FKGAboJU35QW6jcDqg=
92+
file_glob: true
93+
file: releases/sugarcrm-ProfessorM-*.zip
9094
skip_cleanup: true

README.md

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Professor M's School for Gifted Coders [![Build Status](https://travis-ci.org/sugarcrm/school.svg?branch=windows-build-pack-php)](https://travis-ci.org/sugarcrm/school)
22

3-
All of the tutorials at UnCon 2017 will be based on Professor M's School for Gifted Coders. The following sections will explain more about the scenario and how to install the required modules and sample data.
3+
Professor M's School for Gifted Coders is a module loadable package that can be installed in Sugar. The following
4+
sections explain more about the scenario and how to install the package and sample data.
45

56
## Contents
67
[About the scenario](#about-the-scenario)
@@ -26,13 +27,11 @@ Professor M aka Professor Marum has created an exclusive not-for-profit school f
2627

2728
Learn more about the implemented [Use Cases](docs/UseCases.md) in the [docs](docs/).
2829

29-
Want a quick summary? Watch the video below we put together for SugarCon 2017.
30+
Want a quick summary? Watch the video below.
3031
[![The Professor M Scenario Part 1 - What is it and why should you care?](images/profmvideo1.png)](https://youtu.be/aKBTKcaney4 "The Professor M Scenario Part 1 - What is it and why should you care?")
3132

3233
## Installation instructions
3334

34-
Before beginning any of the tutorials associated with UnCon 2017, you'll want to setup a Sugar instance that has the Professor M scenario installed.
35-
3635
Watch the video below for instructions on how to install the scenario. Text-based instructions follow.
3736
[![The Professor M Scenario Part 2 - How do you install it?](images/profmvideo2.png)](https://youtu.be/SO-Rav35X5U "The Professor M Scenario Part 2 - How do you install it?")
3837

@@ -44,7 +43,10 @@ Watch the video below for instructions on how to install the scenario. Text-bas
4443

4544
### Install the modules and customizations
4645
We've created a custom package you can install. The package will create and customize the modules you'll need for the scenario. The following instructions will walk you throw how to install the package.
47-
1. Download **sugarcrm-ProfessorM-standard.zip** from the latest [release](https://github.com/sugarcrm/school/releases)
46+
1. Download the appropriate zip file from the latest [release](https://github.com/sugarcrm/school/releases). If you are
47+
installing in Sugar Cloud, you will need to select the **production** version of the release. If you are installing
48+
elsewhere, you can select the **production** release or the **standard** release. The **standard** release includes
49+
automated testing files while the **production** release does not.
4850
1. Login to Sugar as an Administrator
4951
1. Navigate to **Administration** > **Module Loader**
5052
1. Upload **sugarcrm-ProfessorM-standard.zip**
@@ -56,6 +58,10 @@ We've created a custom package you can install. The package will create and cus
5658
1. Install the zip as a module loadable package using the steps above.
5759
1. Download **sugarcrm-ProfessorM-windows-manual-install.zip** from the latest [release](https://github.com/sugarcrm/school/releases).
5860
1. Unzip the file. Note that you'll find **ProfMForWindowsReadme.txt** and a set of directories inside of the zip.
61+
If no directories are inside the zip, then all file paths in the `package/src` directory have been deemed short
62+
enough to be included in a typical Windows installation and you will need to generate the zips yourself locally
63+
on your own machine (see [Generating the Professor M module loadable packages locally](#generating-the-professor-m-module-loadable-packages-locally)
64+
for instructions on how to do so).
5965
1. Open **ProfMForWindowsReadme.txt**.
6066
1. Follow the instructions inside of the readme to manually copy the files from the zip to your Sugar instance. You
6167
may need to create directories in your Sugar directory if they do not already exist.
@@ -77,12 +83,9 @@ Sugar will display many modules by default that you will not be using while work
7783
* Tasks
7884
* Notes
7985
* Emails
80-
* Campaigns
8186
* Targets
8287
* Target Lists
8388
* Forecasts
84-
* Processes
85-
* Process Business Rules
8689
* Documents
8790
* Cases
8891
* Tags
@@ -95,13 +98,16 @@ Sugar will display many modules by default that you will not be using while work
9598
* Revenue Line Items
9699
* Quotes
97100
* Reports
101+
* Campaigns
98102
* Process Email Templates
99103
* Process Definitions
104+
* Process Business Rules
105+
* Processes
100106
1. Click **Save**
101107

102108
### Use the Sugar REST API to create the Professor M sample data
103109
In order to create the Professor M sample data, you'll use Postman to run a collection of Sugar REST API calls. Each call in the collection has one or more simple tests associated with it to ensure the call was successful.
104-
1. Save a copy of [ProfessorM_PostmanCollection.json](https://raw.githubusercontent.com/sugarcrm/uncon/2017/ProfessorM/ProfessorM_SampleData/ProfessorM_PostmanCollection.json)
110+
1. Save a copy of [ProfessorM_PostmanCollection.json](https://raw.githubusercontent.com/sugarcrm/school/master/data/ProfessorM_PostmanCollection.json)
105111
1. In Postman, click **Import**
106112
1. Click **Choose Files** and import **ProfessorM_PostmanCollection.json**
107113
1. Click the gear icon in the upper right corner and select **Manage Enviornments**
@@ -121,7 +127,9 @@ In order to create the Professor M sample data, you'll use Postman to run a coll
121127
1. Wait for the collection to finish running. All tests should pass.
122128
Hint: If you see many failures, you may have forgotten to install the Professor M module loadable package. See the
123129
instructions in previous section for how to do the install.
124-
130+
131+
If you are using an Enterprise or Ultimate edition of Sugar, you can use the features that leverage Advanced Workflow.
132+
Save a copy of [ProfessorM_PostmanCollection_AdvancedWorkflow.json](https://raw.githubusercontent.com/sugarcrm/school/master/data/ProfessorM_PostmanCollection_AdvancedWorkflow.json) and (https://raw.githubusercontent.com/sugarcrm/school/master/data/Application_Routing.bpm) to your local filesystem. Update the reference to Application_Routing.bpm in ProfessorM_PostmanCollection_AdvancedWorkflow.json to point to your local filesystem location for that file. Then follow the steps above to import the collection and run it.
125133

126134
## Setting up your development environment
127135
If you want to generate the Professor M module loadable packages yourself or make changes to the code in this repo, you
@@ -492,11 +500,11 @@ your `school/package` directory:
492500
493501
The PHPUnit tests can be executed by running the following command from your `school/tests/phpunit` directory on macOS:
494502
```
495-
../../vendor/bin/phpunit
503+
../../package/vendor/bin/phpunit
496504
```
497505
or on Windows:
498506
```
499-
..\..\vendor\bin\phpunit
507+
..\..\package\vendor\bin\phpunit
500508
```
501509
502510
##### Automatic execution in Travis CI
@@ -569,9 +577,9 @@ tests.
569577
Install Yarn which is an NPM compatible package manager. See
570578
[Yarn Installation Guide](https://yarnpkg.com/lang/en/docs/install/) for more details on how to install Yarn.
571579
572-
Next navigate to your school directory and then execute the following commands.
580+
Next navigate to your `school` directory and then execute the following commands.
573581
574-
Navigate to the tests/jasmine directory.
582+
Navigate to the `tests/jasmine` directory.
575583
```
576584
cd tests/jasmine
577585
```
@@ -653,7 +661,7 @@ Currently, we have PHPUnit tests and Postman tests.
653661
654662
#### PHPUnit tests for the Professor M Module Loadable Package
655663
[PHPUnit](https://phpunit.de/) is a testing framework for PHP. The PHPUnit test files are located in
656-
[package/src/custom/tests/School/unit-php](package/src/custom/tests/School/unit-php).
664+
[package/src/custom/tests/unit-php/School](package/src/custom/tests/unit-php/School).
657665
658666
##### Manual execution
659667
@@ -689,7 +697,7 @@ for instructions on setting up a development environment.
689697
You will also need to get a copy of the Sugar provided unit tests and put them in your Sugar source code directory. See
690698
the [SugarCRM unit tests GitHub repo](https://github.com/sugarcrm/unit-tests) for more information.
691699
692-
Prepare to run the Sugar provided PHPUnit tests by executing the following commands:
700+
Prepare to run the Sugar provided PHPUnit tests and the Professor M PHPUnit tests by executing the following commands:
693701
```
694702
$ cd /path/to/sugar_source_dir
695703
$ composer install
@@ -703,22 +711,15 @@ Run the Sugar provided unit tests by executing the following command from the `t
703711
$ ../../vendor/bin/phpunit
704712
```
705713
706-
Install the Professor M Module Loadable Package using
714+
Install the **standard** version of the Professor M Module Loadable Package using
707715
[Module Loader](https://support.sugarcrm.com/SmartLinks/Administration_Guide/Developer_Tools/Module_Loader/index.html)
708716
if you have not already done so. The code for
709717
Professor M and the associated tests will be installed in to the Sugar source directory.
710718
711-
Prepare to run the Professor M PHPUnit tests by executing the following commands:
712-
```
713-
$ cd /path/to/sugar_source_dir
714-
$ cd custom/tests/School/unit-php
715-
$ chmod +x ../../../../vendor/bin/phpunit
716-
```
717-
718-
Run the Professor M PHPUnit tests by executing the following command from the `/custom/tests/School/unit-php` directory:
719+
Run the Professor M PHPUnit tests by executing the following command from the `tests/unit-php` directory:
719720
720721
```
721-
$ ../../../../vendor/bin/phpunit
722+
$ ../../vendor/bin/phpunit --testsuite custom
722723
```
723724
724725
##### Automatic execution in Travis CI
@@ -793,19 +794,22 @@ If a PHPUnit test fails, you'll see something like the following in the job log.
793794
794795
#### Postman tests for the Professor M Module Loadable Package
795796
796-
[Postman](https://www.getpostman.com/) is an API development environment. We use a Postman Collection to insert our
797-
sample data into Sugar via the REST API. Each API call in the collection has one or more associated tests to ensure
797+
[Postman](https://www.getpostman.com/) is an API development environment. We use Postman Collections to insert our
798+
sample data into Sugar via the REST API. Each API call in the collections has one or more associated tests to ensure
798799
the calls were successful.
799800
800-
The Postman Collection can be run via the Postman application as described
801+
The Postman Collections can be run via the Postman application as described
801802
[above](#use-the-sugar-rest-api-to-create-the-professor-m-sample-data) or the command line using
802803
[Newman](https://www.getpostman.com/docs/v6/postman/collection_runs/command_line_integration_with_newman).
803804
804805
##### Manual execution using the command line interface
805806
806-
You can execute the tests against any running instance of Sugar. The first step is to configure the Postman Environment
807-
for your particular instance of Sugar. Open [ProfessorM_PostmanEnvironment](data/ProfessorM_PostmanEnvironment.json)
808-
and update the url, username, password, and rest_endpoint to reflect your instance.
807+
You can execute the tests against any running instance of Sugar. Note that the Postman tests will NOT be installed
808+
as part of the Professor M module loadable package. The tests will only be available in your `school` repo.
809+
810+
The first step is to configure the Postman Environment for your particular instance of Sugar. Open
811+
[ProfessorM_PostmanEnvironment](data/ProfessorM_PostmanEnvironment.json) and update the url, username, password, and
812+
rest_endpoint to reflect your instance.
809813
810814
Then you can choose to install Newman to execute the tests or use a Docker image to execute the tests.
811815
@@ -821,6 +825,11 @@ Navigate to the `school/data` directory in your shell. Execute the tests by run
821825
822826
`newman run ProfessorM_PostmanCollection.json -e ProfessorM_PostmanEnvironment.json`
823827
828+
You can execute the tests that leverage Advanced Workflow (only available in Enterprise and Ultimate editions of Sugar)
829+
by running the following:
830+
831+
`newman run ProfessorM_PostmanCollection_AdvancedWorkflow.json -e ProfessorM_PostmanEnvironment.json`
832+
824833
###### Using Docker
825834
826835
[Install Docker](https://docs.docker.com/install) if you haven't already.
@@ -835,6 +844,11 @@ Execute the tests by running the following:
835844
836845
Be sure to replace `pathToTheDataDirectoryInYourSchoolRepo` with the path to the `data` directory in your school repo.
837846
847+
You can execute the tests that leverage Advanced Workflow (only available in Enterprise and Ultimate editions of Sugar)
848+
by running the following:
849+
850+
`docker run -v pathToTheDataDirectoryInYourSchoolRepo:/etc/newman -t postman/newman_ubuntu1404 run "ProfessorM_PostmanCollection_AdvancedWorkflow.json" --environment="ProfessorM_PostmanEnvironment.json"`
851+
838852
Hint: If your instance of Sugar is running inside a Docker container, you may need to add the `--net="host"` option:
839853
840854
`docker run -v pathToTheDataDirectoryInYourSchoolRepo:/etc/newman --net="host" -t postman/newman_ubuntu1404 run "ProfessorM_PostmanCollection.json" --environment="ProfessorM_PostmanEnvironment.json"`

data/Application_Routing.bpm

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)