Skip to content

Commit 0249582

Browse files
authored
Merge pull request #165 from open-runtimes/fix-flaky-tests
Fix: flaky Dart test
2 parents 84ae68a + adc5ac3 commit 0249582

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

tests/ExecutorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ public function testCustomRuntimes(string $folder, string $image, string $entryp
11231123
$this->assertEquals('Hello Open Runtimes 👋', $response['message']);
11241124
$this->assertEquals('Variable secret', $response['variable']);
11251125
$this->assertEquals('https://cloud.appwrite.io/my-awesome/path?param=paramValue', $response['url']);
1126-
$this->assertEquals(1, $response['todo']['userId']);
1126+
$this->assertEquals(13, $response['todo']['userId']);
11271127

11281128
/** Delete runtime */
11291129
$response = $this->client->call(Client::METHOD_DELETE, "/runtimes/custom-execute-{$folder}-{$runtimeId}", [], []);

tests/resources/functions/cpp/index.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace runtime {
3131
curl = curl_easy_init();
3232
if (curl)
3333
{
34-
std::string url = "https://jsonplaceholder.typicode.com/todos/" + id;
34+
std::string url = "https://dummyjson.com/todos/" + id;
3535
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
3636
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
3737
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &todoBuffer);

tests/resources/functions/dart/lib/index.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'dart:io' show Platform;
55

66
Future<dynamic> main(final context) async {
77
final id = context.req.body['id'] ?? '1';
8-
final todo = await Dio().get('https://jsonplaceholder.typicode.com/todos/$id');
8+
final todo = await Dio().get('https://dummyjson.com/todos/$id');
99
context.log('Sample Log');
1010

1111
return context.res.json({

tests/resources/functions/deno/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import axiod from "https://deno.land/x/axiod/mod.ts";
22

33
export default async function(context: any) {
4-
const todo = (await axiod.get(`https://jsonplaceholder.typicode.com/todos/${context.req.body.id ?? 1}`)).data;
4+
const todo = (await axiod.get(`https://dummyjson.com/todos/${context.req.body.id ?? 1}`)).data;
55

66
context.log('Sample Log');
77

tests/resources/functions/dotnet/Index.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public async Task<RuntimeOutput> Main(RuntimeContext Context)
1313
string id = Body.TryGetValue("id", out var value) == true ? value.ToString()! : "1";
1414
var varData = Environment.GetEnvironmentVariable("TEST_VARIABLE") ?? null;
1515

16-
var response = await http.GetStringAsync($"https://jsonplaceholder.typicode.com/todos/" + id);
16+
var response = await http.GetStringAsync($"https://dummyjson.com/todos/" + id);
1717
var todo = JsonConvert.DeserializeObject<Dictionary<string, object>>(response, settings: null);
1818

1919
Context.Log("Sample Log");

tests/resources/functions/node/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const fetch = require("node-fetch");
22

33
module.exports = async (context)=> {
4-
const todo = await fetch(`https://jsonplaceholder.typicode.com/todos/${context.req.body.id ?? 1}`).then(r => r.json());
4+
const todo = await fetch(`https://dummyjson.com/todos/${context.req.body.id ?? 1}`).then(r => r.json());
55
context.log('Sample Log');
66

77
return context.res.json({

tests/resources/functions/php/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use GuzzleHttp\Client;
77

88
$client = new Client([
9-
'base_uri' => 'https://jsonplaceholder.typicode.com'
9+
'base_uri' => 'https://dummyjson.com'
1010
]);
1111

1212
return function ($context) use ($client) {

tests/resources/functions/python/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def main(context):
66
todo_id = context.req.body.get('id', 1)
77
var_data = os.environ.get('TEST_VARIABLE', None)
88

9-
todo = (requests.get('https://jsonplaceholder.typicode.com/todos/' + str(todo_id))).json()
9+
todo = (requests.get('https://dummyjson.com/todos/' + str(todo_id))).json()
1010

1111
context.log('Sample Log')
1212

tests/resources/functions/ruby/index.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'json'
33

44
def main(context)
5-
todo = JSON.parse(HTTParty.get("https://jsonplaceholder.typicode.com/todos/" + (context.req.body['id'] || '1')).body)
5+
todo = JSON.parse(HTTParty.get("https://dummyjson.com/todos/" + (context.req.body['id'] || '1')).body)
66

77
context.log('Sample Log')
88

0 commit comments

Comments
 (0)