Skip to content

Commit c86063a

Browse files
docs(srv): update test procedures & tb MTA-6708 (#5810)
* docs(srv): update docs on testing resources MTA-6725 * docs(srv): update doc on testing resource
1 parent 0d3c0cc commit c86063a

File tree

4 files changed

+28
-16
lines changed

4 files changed

+28
-16
lines changed

pages/serverless-containers/how-to/test-a-container.mdx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ import Requirements from '@macros/iam/requirements.mdx'
1111

1212
This page shows you how to execute Serverless Containers from the [Scaleway console](https://console.scaleway.com). The **Test** feature of a container allows you to run your code using a selection of methods to make sure it behaves as expected.
1313

14-
<Message type="note">
15-
Testing **Private** Serverless Functions is not possible using the Scaleway console due to CORS limitations. Refer to the [dedicated documentation](/serverless-containers/how-to/create-auth-token-from-console/) for more information on how to secure and test a private function.
16-
</Message>
17-
1814
<Requirements />
1915

2016
- A Scaleway account logged into the [console](https://console.scaleway.com)
@@ -35,9 +31,18 @@ Testing **Private** Serverless Functions is not possible using the Scaleway cons
3531

3632
7. Click **+ Advanced options** to add any required HTTP header or parameter to your container.
3733

38-
8. Click **Run**.
34+
8. Copy the generated command, then execute it in a terminal.
35+
36+
<Message type="note">
37+
Testing a private container requires you use an [authentication token](/serverless-containers/how-to/create-auth-token-from-console/) as a header, as shown below:
38+
39+
```bash
40+
export $TOKEN=<YOUR_AUTH_TOKEN>
41+
curl -H "X-Auth-Token: $TOKEN" \ <YOUR_FUNCTION_ENDPOINT>
42+
````
43+
</Message>
3944

40-
The **Output** section displays the response from your container and the status code.
45+
The output of your terminal displays the response from your container, and the status code.
4146

4247
<Message type="note">
4348
If you encounter a message error while testing your container, refer to the [dedicated troubleshooting](/serverless-containers/troubleshooting/tests-fail-on-container/) for more information.

pages/serverless-containers/troubleshooting/tests-fail-on-container.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ I get error messages when testing Serverless Containers using the Scaleway Conso
1313

1414
## Cause
1515

16-
Testing **Private** Serverless Containers is not possible using the Scaleway console due to CORS limitations.
16+
**Private** Serverless Containers require you use an authentication token.
1717

1818
## Possible solutions
1919

2020
- Change the visibility of your function to **public**. Public containers can be executed anonymously.
2121

2222
- Make sure you have created an [authentication token](/serverless-containers/how-to/create-auth-token-from-console/) for your private function, then execute a `curl` request from a terminal, as shown below:
2323
```bash
24-
curl -H "X-Auth-Token: <YOUR_AUTH_TOKEN>" \ <YOUR_CONTAINER_ENDPOINT>
24+
export $TOKEN=<YOUR_AUTH_TOKEN>
25+
curl -H "X-Auth-Token: $TOKEN" \ <YOUR_CONTAINER_ENDPOINT>
2526
```

pages/serverless-functions/how-to/test-a-function.mdx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ import Requirements from '@macros/iam/requirements.mdx'
1111

1212
This page shows you how to execute Serverless Functions from the [Scaleway console](https://console.scaleway.com). The **Test** feature of a function allows you to run your code using a selection of methods to make sure it behaves as expected.
1313

14-
<Message type="note">
15-
Testing **Private** Serverless Functions is not possible using the Scaleway console due to CORS limitations. Refer to the [dedicated documentation](/serverless-functions/how-to/create-auth-token-from-console/) for more information on how to secure and test a private function.
16-
</Message>
17-
1814
<Requirements />
1915

2016
- A Scaleway account logged into the [console](https://console.scaleway.com)
@@ -35,9 +31,18 @@ Testing **Private** Serverless Functions is not possible using the Scaleway cons
3531

3632
7. Click **+ Advanced options** to add any required HTTP header or parameter to your function.
3733

38-
8. Click **Run**.
34+
8. Copy the generated command, then execute it in a terminal.
35+
36+
<Message type="note">
37+
Testing a private function requires you use an [authentication token](/serverless-functions/how-to/create-auth-token-from-console/) as a header, as shown below:
38+
39+
```bash
40+
export $TOKEN=<YOUR_AUTH_TOKEN>
41+
curl -H "X-Auth-Token: $TOKEN" \ <YOUR_FUNCTION_ENDPOINT>
42+
````
43+
</Message>
3944

40-
The **Output** section displays the response from your function and the status code.
45+
The output of your terminal displays the response from your function, and the status code.
4146

4247
<Message type="note">
4348
If you encounter a message error while testing your function, refer to the [dedicated troubleshooting](/serverless-functions/troubleshooting/tests-fail-on-function/) for more information.

pages/serverless-functions/troubleshooting/tests-fail-on-function.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ I get error messages when testing Serverless Functions using the Scaleway Consol
1313

1414
## Cause
1515

16-
Testing **Private** Serverless Functions is not possible using the Scaleway console due to CORS limitations.
16+
**Private** Serverless Functions require you use an authentication token.
1717

1818
## Possible solutions
1919

2020
- Change the visibility of your function to **public**. Public functions can be executed anonymously.
2121

2222
- Make sure you have created an [authentication token](/serverless-functions/how-to/create-auth-token-from-console/) for your private function, then execute a `curl` request from a terminal, as shown below:
2323
```bash
24-
curl -H "X-Auth-Token: <YOUR_AUTH_TOKEN>" \ <YOUR_FUNCTION_ENDPOINT>
24+
export $TOKEN=<YOUR_AUTH_TOKEN>
25+
curl -H "X-Auth-Token: $TOKEN" \ <YOUR_FUNCTION_ENDPOINT>
2526
```

0 commit comments

Comments
 (0)