GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add test for stopping Bedrock AgentCore sessions · xp-forge/aws@8694a7c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • main/php/com/amazon/aws
      • ServiceEndpoint.class.php
    • test/php/com/amazon/aws/unittest
      • RequestTest.class.php
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/main/php/com/amazon/aws/ServiceEndpoint.class.php‎

Copy file name to clipboardExpand all lines: src/main/php/com/amazon/aws/ServiceEndpoint.class.php
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ public function open(string $method, $target, array $headers, $hash= null, $time
213213
// Create and sign request
214214
$request= $conn->create(new HttpRequest());
215215
$request->setMethod($method);
216-
$request->setTarget($encoded);
216+
$request->setTarget($params
217+
? $encoded.'?'.http_build_query($params, '', '&', PHP_QUERY_RFC3986)
218+
: $encoded
219+
);
217220
$request->addHeaders($headers);
218221

219222
// Compile headers from given host and time including our user agent
Collapse file

‎src/test/php/com/amazon/aws/unittest/RequestTest.class.php‎

Copy file name to clipboardExpand all lines: src/test/php/com/amazon/aws/unittest/RequestTest.class.php
+20-3Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ private function agentcore(): ServiceEndpoint {
4141
'Content-Type: application/vnd.amazon.eventstream',
4242
'x-amzn-code-interpreter-session-id: '.$request->headers['x-amzn-code-interpreter-session-id'][0],
4343
'',
44-
'...'
44+
'...',
45+
],
46+
'PUT /code-interpreters/test.v1/sessions/stop?sessionId='.self::SESSION => [
47+
'HTTP/1.1 200 OK',
48+
'Content-Type: application/json',
49+
'',
50+
'{"sessionId": "'.self::SESSION.'"}',
4551
],
4652
]);
4753
}
@@ -76,8 +82,7 @@ public function invoke_lambda_with_version() {
7682
}
7783

7884
#[Test]
79-
public function start_agentcode_session() {
80-
$sessions= ['x-amzn-code-interpreter-session-id' => self::SESSION];
85+
public function start_agentcore_session() {
8186
$start= [
8287
'name' => 'code-sesion-6100',
8388
'description' => 'Test session',
@@ -93,6 +98,18 @@ public function start_agentcode_session() {
9398
Assert::equals(['sessionId' => self::SESSION], $response->value());
9499
}
95100

101+
#[Test]
102+
public function stop_agentcore_session() {
103+
$response= $this->agentcore()
104+
->resource('/code-interpreters/test.v1/sessions/stop?sessionId='.self::SESSION)
105+
->transmit((object)[], 'application/json', 'PUT')
106+
;
107+
108+
Assert::equals(200, $response->status());
109+
Assert::equals('OK', $response->message());
110+
Assert::equals(['sessionId' => self::SESSION], $response->value());
111+
}
112+
96113
#[Test]
97114
public function invoke_agentcore_interpreter() {
98115
$sessions= ['x-amzn-code-interpreter-session-id' => self::SESSION];

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.