Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions menu/navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3781,6 +3781,10 @@
{
"label": "My function fails after too many retries",
"slug": "too-many-retries"
},
{
"label": "Tests fail on functions",
"slug": "tests-fail-on-function"
}
],
"label": "Troubleshooting",
Expand Down Expand Up @@ -3838,6 +3842,10 @@
"label": "Secure a container",
"slug": "secure-a-container"
},
{
"label": "Test a container",
"slug": "test-a-container"
},
{
"label": "Monitor container logs and metrics",
"slug": "monitor-container"
Expand Down Expand Up @@ -3939,6 +3947,10 @@
{
"label": "My container stopped working after a redeploy",
"slug": "container-stopped-after-redeploy"
},
{
"label": "Tests fail on containers",
"slug": "tests-fail-on-container"
}
],
"label": "Troubleshooting",
Expand Down
48 changes: 48 additions & 0 deletions serverless/containers/how-to/test-a-container.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
meta:
title: How to test a container
description: Instructions for testing your Serverless Containers on Scaleway.
content:
h1: How to test a container
paragraph: Instructions for testing your Serverless Containers on Scaleway.
tags: container serverless test-container
dates:
validation: 2025-01-14
posted: 2025-01-15
categories:
- serverless
---

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.

<Message type="note">
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.
</Message>

<Macro id="requirements" />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- [Created a container](/serverless/containers/how-to/deploy-container/)

1. Click **Containers** in the **Serverless** section of the side menu. The containers page displays.

2. Click the relevant containers namespace. A list of your containers displays.

3. Click the name of the container you want to test.

4. Open the **Test** tab.

5. Select the **method** you want to use from the drop-down menu.

6. Enter the **path** to your container. Leave the default `/` value if the host of your container is not located in a specific folder.

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

8. Click **Run**.

The **Output** section displays the response from your container and the status code.

<Message type="note">
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.
</Message>
31 changes: 31 additions & 0 deletions serverless/containers/troubleshooting/tests-fail-on-container.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
meta:
title: Tests fail on Serverless Containers
description: I get error messages when testing Serverless Containers using the Scaleway Console
content:
h1: Tests fail on Serverless Containers
paragraph: I get error messages when testing Serverless Containers using the Scaleway Console
tags: serverless containers private troubleshooting issue error test authentication token unable
dates:
validation: 2025-01-14
posted: 2025-01-14
categories:
- serverless
---

## Problem

I get error messages when testing Serverless Containers using the Scaleway Console.

### Cause

Testing **Private** Serverless Containers is not possible using the Scaleway console due to CORS limitations.

### Possible solutions

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

- Make sure you have created an [authentication token](/serverless/containers/how-to/create-auth-token-from-console/) for your private function, then exexute a `curl` request from a terminal, as shown below:
```sh
curl -H "X-Auth-Token: <YOUR_AUTH_TOKEN>" \ <YOUR_CONTAINER_ENDPOINT>
```
8 changes: 8 additions & 0 deletions serverless/functions/how-to/test-a-function.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ categories:

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.

<Message type="note">
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.
</Message>

<Macro id="requirements" />

- A Scaleway account logged into the [console](https://console.scaleway.com)
Expand All @@ -38,3 +42,7 @@ This page shows you how to execute Serverless Functions from the [Scaleway conso
8. Click **Run**.

The **Output** section displays the response from your function and the status code.

<Message type="note">
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.
</Message>
31 changes: 31 additions & 0 deletions serverless/functions/troubleshooting/tests-fail-on-function.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
meta:
title: Tests fail on Serverless Functions
description: I get error messages when testing Serverless Functions using the Scaleway Console
content:
h1: Tests fail on Serverless Functions
paragraph: I get error messages when testing Serverless Functions using the Scaleway Console
tags: serverless functions private troubleshooting issue error test authentication token unable
dates:
validation: 2025-01-14
posted: 2025-01-14
categories:
- serverless
---

## Problem

I get error messages when testing Serverless Functions using the Scaleway Console.

### Cause

Testing **Private** Serverless Functions is not possible using the Scaleway console due to CORS limitations.

### Possible solutions

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

- Make sure you have created an [authentication token](/serverless/functions/how-to/create-auth-token-from-console/) for your private function, then exexute a `curl` request from a terminal, as shown below:
```sh
curl -H "X-Auth-Token: <YOUR_AUTH_TOKEN>" \ <YOUR_FUNCTION_ENDPOINT>
```
Loading