Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd8c18e

Browse files
committed
Merge branch 'MAGECLOUD-1792-no-ssh' of github.com:magento/devdocs_internal into MAGECLOUD-1792-no-ssh
2 parents 90a8a58 + 49dbbe2 commit fd8c18e

File tree

27 files changed

+505
-412
lines changed

27 files changed

+505
-412
lines changed

css/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

guides/v2.0/test/integration/integration_test_execution.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ The integration test framework creates the temporary test files beneath the dire
143143
To force the test framework to regenerate the cache and the other files, it is enough to remove the directory.
144144

145145
```bash
146-
$ rm -r dev/tests/integration/tmp/sandbox-*
146+
rm -r dev/tests/integration/tmp/sandbox-*
147147
```
148148

149149
#### The PHP memory_limit
@@ -183,7 +183,7 @@ A testsuite configuration like the following can be added to the `<testsuites>`
183183
Such a test suite configuration can then be executed using the `--testsuite <name>` command option, for example if you are in the `dev/tests/integration` directory:
184184

185185
```bash
186-
$ php ../../../vendor/bin/phpunit --testsuite "Third Party Integration Tests"
186+
php ../../../vendor/bin/phpunit --testsuite "Third Party Integration Tests"
187187
```
188188

189189
## Running Integration Tests in the CLI {#cli-run}
@@ -200,8 +200,15 @@ The test configuration resides in that directory and will be picked up by `phpun
200200
By default, if no additional arguments are specified, the test configuration executes all integration tests in the directory `dev/tests/integration/testsuite`.
201201

202202
```bash
203-
$ cd dev/tests/integration
204-
$ ../../../vendor/bin/phpunit
203+
cd dev/tests/integration
204+
```
205+
```bash
206+
../../../vendor/bin/phpunit
207+
```
208+
209+
>Expected log
210+
211+
```terminal
205212
PHPUnit 4.1.0 by Sebastian Bergmann.
206213
207214
Configuration read from /var/www/magento2/dev/tests/integration/phpunit.xml
@@ -217,17 +224,21 @@ PHPUnit offers several ways to only execute a subset of tests.
217224
For example, it is common to only execute a single testsuite from the `phpunit.xml` configuration.
218225

219226
```bash
220-
$ cd dev/tests/integration
221-
$ ../../../vendor/bin/phpunit --testsuite "Memory Usage Tests"
227+
cd dev/tests/integration
228+
```
229+
```bash
230+
../../../vendor/bin/phpunit --testsuite "Memory Usage Tests"
222231
```
223232

224233
### Running a tests from a specific directory tree
225234

226235
To execute only the tests within a specific directory (for example an extension), pass the path to that directory as an argument to `phpunit`.
227236

228237
```bash
229-
$ cd dev/tests/integration
230-
$ ../../../vendor/bin/phpunit ../../../app/code/Acme/Example/Test/Integration
238+
cd dev/tests/integration
239+
```
240+
```bash
241+
../../../vendor/bin/phpunit ../../../app/code/Acme/Example/Test/Integration
231242
```
232243

233244
### Running a single test class
@@ -236,17 +247,21 @@ When developing a new integration test class, it is common to run only that sing
236247
Pass the path to the file containing the test class as an argument to `phpunit`.
237248

238249
```bash
239-
$ cd dev/tests/integration
240-
$ ../../../vendor/bin/phpunit ../../../app/code/Acme/Example/Test/Integration/ExampleTest.php
250+
cd dev/tests/integration
251+
```
252+
```bash
253+
../../../vendor/bin/phpunit ../../../app/code/Acme/Example/Test/Integration/ExampleTest.php
241254
```
242255

243256
### Running a single test within a test class
244257

245258
Running only a single test within a test class can be done by specifying the test class together with the `--filter` argument and the name to select the test currently being developed.
246259

247260
```bash
248-
$ cd dev/tests/integration
249-
$ ../../../vendor/bin/phpunit --filter 'testOnlyThisOneIsExecuted' ../../../app/code/Acme/Example/Test/Integration/ExampleTest.php
261+
cd dev/tests/integration
262+
```
263+
```bash
264+
../../../vendor/bin/phpunit --filter 'testOnlyThisOneIsExecuted' ../../../app/code/Acme/Example/Test/Integration/ExampleTest.php
250265
```
251266

252267
### Common mistakes
@@ -268,7 +283,9 @@ If the tests then are executed using a PHP interpreter on the host system, the d
268283

269284
The error usually looks something like this.
270285
```bash
271-
$ phpunit
286+
phpunit
287+
```
288+
```terminal
272289
exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory' in /var/www/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:129
273290
```
274291

guides/v2.0/test/js/jasmine.md

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,43 +26,52 @@ Magento uses a custom [Grunt] task named `spec` to run Jasmine tests. The task c
2626

2727
**Step 5.** In `<magento_root_dir>`, install all dependencies:
2828

29-
{%highlight bash%}
30-
$ npm install
31-
{%endhighlight%}
29+
```bash
30+
npm install
31+
```
3232

3333
**Step 6.** In `<magento_root_dir>`, generate static view files in Magento that are going to be tested
3434
{:#prepare-step6}
3535

36-
{%highlight bash%}
37-
$ php bin/magento setup:static-content:deploy -f
38-
{%endhighlight%}
36+
```bash
37+
php bin/magento setup:static-content:deploy -f
38+
```
3939

4040
Note that normally you don't have permissions to `<magento_root_dir>/app/code/`, in fact the generated static view file is being tested.
4141

42-
<div class="bs-callout bs-callout-tip" markdown="1">
43-
**For CentOS users**<br/>
44-
If the command fails with error message: <br/>
45-
`/var/www/html/magento2ce/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory`<br/>
46-
install [fonctconfig library](https://www.freedesktop.org/wiki/Software/fontconfig/):{: target="_blank"}<br/>
47-
`$ yum install fontconfig` (CentOS)<br/>
48-
`$ apt-get install fontconfig` (Ubuntu)
49-
</div>
50-
42+
{% include note.html
43+
type="tip"
44+
content="**For CentOS and Ubuntu users**<br/>
45+
If the command fails with the error message:
46+
```terminal
47+
/var/www/html/magento2ce/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory
48+
```
49+
install [fonctconfig library]:<br/>
50+
* CentOS:
51+
```bash
52+
yum install fontconfig
53+
```
54+
* Ubuntu:
55+
```bash
56+
apt-get install fontconfig
57+
```
58+
"
59+
%}
5160
Learn more in [Deploy static view files].
5261

5362
## Run tests
5463

5564
`Gruntfile.js` contains the test run task, so you can run tests for a theme using the following command in the Magento root directory:
5665

57-
{%highlight bash%}
58-
$ grunt spec:<THEME>
59-
{%endhighlight%}
66+
```bash
67+
grunt spec:<THEME>
68+
```
6069

6170
Example:
6271

63-
{%highlight bash%}
64-
$ grunt spec:backend
65-
{%endhighlight%}
72+
```bash
73+
grunt spec:backend
74+
```
6675

6776
## Write a test {#write-test}
6877

@@ -254,22 +263,33 @@ Use --force to continue. Aborted due to warnings.
254263

255264
Run in your terminal:
256265

257-
{%highlight bash%}
258-
$ cd <magento_root>/node_modules/grunt-contrib-jasmine
259-
$ npm install
260-
{%endhighlight%}
266+
```bash
267+
cd <magento_root>/node_modules/grunt-contrib-jasmine
268+
```
269+
```bash
270+
npm install
271+
```
261272

262273
<!-- LINK DEFINITIONS -->
263274

264275
<!-- External -->
265-
[`app/code/Magento/Ui/base/js/grid/columns/actions.test.js`]: https://github.com/magento/magento2/blob/53f18a0efc86c58b8e47a6b114f5db6746fc154c/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/columns/actions.test.js
266-
[`<magento_root_dir>/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js`]: https://github.com/magento/magento2/blob/53f18a0efc86c58b8e47a6b114f5db6746fc154c/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js
267-
276+
<!-- External -->
277+
[`<magento_root_dir>/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js`]: {{site.mage2000url}}app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js
278+
{:target="_blank"}
279+
[`app/code/Magento/Ui/base/js/grid/columns/actions.test.js`]: {{site.mage2000url}}dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/columns/actions.test.js
280+
{:target="_blank"}
268281
[Deploy static view files]: {{page.baseurl}}config-guide/cli/config-cli-subcommands-static-view.html#config-cli-subcommands-xlate-dict
282+
{:target="_blank"}
283+
[fonctconfig library]: https://www.freedesktop.org/wiki/Software/fontconfig/
284+
{:target="_blank"}
269285
[Grunt]: http://gruntjs.com/
286+
{:target="_blank"}
270287
[Install grunt-cli]: http://gruntjs.com/getting-started
288+
{:target="_blank"}
271289
[Install Node.js]: https://nodejs.org/en/
290+
{:target="_blank"}
272291
[Learn more about testing with Jasmine.]: https://jasmine.github.io/edge/introduction.html
292+
{:target="_blank"}
273293

274294
<!-- Internal -->
275295
[Step 6]: #prepare-step6

guides/v2.0/test/unit/unit_test_execution_cli.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ functional_areas:
1515

1616
To run all tests, navigate to the Magento base directory and execute the following command:
1717

18-
{%highlight bash%}
19-
$ ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist
20-
{%endhighlight%}
18+
```bash
19+
./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist
20+
```
2121

2222
### Running only a subset of the unit tests
2323

2424
To run only tests within a specific directory branch, all you have to do is to specify the directory branch after the command.
2525

2626
The following example tells PHPUnit to look for any file ending with `Test.php` within the directory branch `app/code/Example/Module/Test/Unit` and try to execute it.
2727

28-
{%highlight bash%}
29-
$ ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/Example/Module/Test/Unit
30-
{%endhighlight%}
28+
```bash
29+
./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/Example/Module/Test/Unit
30+
```
3131

3232
#### Explanation
3333

@@ -46,9 +46,9 @@ One possible reason for this to happen might be if you are trying to execute PHP
4646

4747
Whatever the reason, if you encounter the `permission denied: vendor/bin/phpunit` error, you can prefix the command with the {% glossarytooltip bf703ab1-ca4b-48f9-b2b7-16a81fd46e02 %}PHP{% endglossarytooltip %} interpreter, so your system knows what binary to use to run the tests.
4848

49-
{%highlight bash%}
50-
$ php -f vendor/bin/phpunit -- -c dev/tests/unit/phpunit.xml.dist
51-
{%endhighlight%}
49+
```bash
50+
php -f vendor/bin/phpunit -- -c dev/tests/unit/phpunit.xml.dist
51+
```
5252

5353
#### Use the correct PHP interpreter
5454
On many development systems, you might have more one PHP version installed. You must know the correct PHP interpreter to use for testing; that is, Buse the same version of PHP to run the unit tests you use to run Magento.
@@ -65,9 +65,9 @@ Some examples follow:
6565

6666
You can either fix your `$PATH` (please refer to your system documentation on how to do that), or specify the full path to the PHP interpreter. For example:
6767

68-
{%highlight bash%}
69-
$ /usr/local/Cellar/php56/5.6.19/bin/php -f vendor/bin/phpunit -- -c dev/tests/unit/phpunit.xml.dist
70-
{%endhighlight%}
68+
```bash
69+
/usr/local/Cellar/php56/5.6.19/bin/php -f vendor/bin/phpunit -- -c dev/tests/unit/phpunit.xml.dist
70+
```
7171

7272
#### Memory Limit
7373
If you encounter an error similar to `Fatal error: Allowed memory size of 67108864 bytes exhausted`, follow these steps to resolve it.

guides/v2.1/cloud/access-acct/fastly.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,24 @@ You can add multiple backends. Repeat these instructions to create multiple back
157157
2. Expand **Backend settings** and click the gear to configure the default backend. A modal opens with options to select and configure.
158158

159159
![Modify the backend]({{ site.baseurl }}common/images/cloud_fastly-backend.png){:width="600px"}
160-
3. Select a **Shield** location (or datacenter) closest to your server region. For example, if Staging is on the West Coast of the United States (US - Oregon), you may want to select a shield in US, Los Angeles, CA. This is the POP accessed for providing caching services. For example, we have cloud hosting in the following AWS locations:
161-
162-
* US - Oregon
163-
* EU - Dublin
164-
* APAC - Sydney
160+
3. Select the **Shield** location (or datacenter) closest to your AWS region. For example, if Staging is on the west coast of the United States (us-west-1), select the `sjc-ca-us` Fastly shield location. This is the POP that provides caching services.
161+
162+
The following list shows which Faslty shield locations to use based an AWS region:
163+
164+
- ap-northeast-1 => tokyo-jp2
165+
- ap-southeast-1 => singapore-sg
166+
- ap-southeast-2 => sydney-au
167+
- ap-south-1 => singapore-sg
168+
- eu-central-1 => frankfurt-de
169+
- eu-west-1 => london-uk, london_city-uk
170+
- eu-west-2 => london-uk, london_city-uk
171+
- eu-west-3 => cdg-par-fr
172+
- sa-east-1 => gru-br-sa
173+
- us-east-1 => iad-va-us
174+
- us-east-2 => iad-va-us
175+
- us-west-1 => sjc-ca-us
176+
- us-west-2 => sea-wa-us
177+
165178
4. Modify the timeout values (in miliseconds) for the connection to the shield, time between bytes, and time for the first byte. We recommend keeping the default timeout settings.
166179
5. Optionally, select to Activate the backend and Shield after editing or saving.
167180
6. Click **Upload** to save. The settings are commiunicated to Fastly.

0 commit comments

Comments
 (0)