diff --git a/menu/navigation.json b/menu/navigation.json index e845642fe4..e87765a113 100644 --- a/menu/navigation.json +++ b/menu/navigation.json @@ -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", @@ -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" @@ -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", diff --git a/serverless/containers/how-to/test-a-container.mdx b/serverless/containers/how-to/test-a-container.mdx new file mode 100644 index 0000000000..97dc2bbdf2 --- /dev/null +++ b/serverless/containers/how-to/test-a-container.mdx @@ -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. + + +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. + + + + +- 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. + + +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. + \ No newline at end of file diff --git a/serverless/containers/troubleshooting/tests-fail-on-container.mdx b/serverless/containers/troubleshooting/tests-fail-on-container.mdx new file mode 100644 index 0000000000..701f2c16a0 --- /dev/null +++ b/serverless/containers/troubleshooting/tests-fail-on-container.mdx @@ -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: " \ + ``` \ No newline at end of file diff --git a/serverless/functions/how-to/test-a-function.mdx b/serverless/functions/how-to/test-a-function.mdx index be4f554437..a5e69b03a9 100644 --- a/serverless/functions/how-to/test-a-function.mdx +++ b/serverless/functions/how-to/test-a-function.mdx @@ -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. + +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. + + - A Scaleway account logged into the [console](https://console.scaleway.com) @@ -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. + + +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. + \ No newline at end of file diff --git a/serverless/functions/troubleshooting/tests-fail-on-function.mdx b/serverless/functions/troubleshooting/tests-fail-on-function.mdx new file mode 100644 index 0000000000..42b5d4fa10 --- /dev/null +++ b/serverless/functions/troubleshooting/tests-fail-on-function.mdx @@ -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: " \ + ``` \ No newline at end of file