Skip to content

chore(TestServer): add multilanguage test server, run in CI#3

Merged
kessplas merged 13 commits into
stagingfrom
add-test-server
Sep 3, 2025
Merged

chore(TestServer): add multilanguage test server, run in CI#3
kessplas merged 13 commits into
stagingfrom
add-test-server

Conversation

@kessplas

@kessplas kessplas commented Aug 16, 2025

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

Adds the smithy-based multilanguage TestServer to S3EC Python repo and runs it in CI. Some notes:

  • In the future, we will want to refactor how this is packaged. The most obvious approach would be to move the tests to a singular repository. Each language implementation would then depend on this artifact and run tests against its "local" copy of the S3EC.
    • For now, I'm just leaving it in S3EC Python.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kessplas kessplas changed the base branch from main to staging August 16, 2025 00:05
@kessplas kessplas changed the title Add test server chore(TestServer): add multilanguage test server, run in CI Aug 18, 2025
@kessplas kessplas marked this pull request as ready for review August 19, 2025 19:49
@lucasmcdonald3 lucasmcdonald3 requested a review from Copilot August 19, 2025 19:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a multilanguage test server framework to the S3 Encryption Client Python repository for cross-language compatibility testing in CI. The framework uses Smithy to define a shared API model and provides both Java and Python server implementations.

  • Adds a Smithy-based test server with model definitions for S3EC operations
  • Implements Java and Python server versions that expose S3 Encryption Client functionality via HTTP APIs
  • Creates comprehensive Java integration tests that verify cross-language interoperability

Reviewed Changes

Copilot reviewed 40 out of 43 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
test-server/model/ Smithy API definitions for test server interface
test-server/java-server/ Java server implementation using generated Smithy stubs
test-server/python-server/ Python FastAPI server implementation
test-server/java-tests/ Java integration tests for cross-language validation
test-server/Makefile Build and orchestration scripts for running servers and tests
.github/workflows/test.yml CI integration for automated test execution
cdk/lib/cdk-stack.ts AWS infrastructure updates for test server resources

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread test-server/python-server/src/main.py Outdated
Comment thread test-server/python-server/README.md Outdated
Comment thread test-server/python-server/README.md Outdated
Comment thread test-server/python-server/README.md Outdated
Comment thread test-server/python-server/README.md Outdated
- `GET /` - Welcome message
- `POST /get-beer` - Get a beer with specified ID
- Request body: `{"Id": "string"}`
- Response: `{"beer": "beer{Id}"}`

Copilot AI Aug 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This documentation describes a non-existent endpoint and should be removed or corrected.

Suggested change
- Response: `{"beer": "beer{Id}"}`

Copilot uses AI. Check for mistakes.
Comment thread test-server/python-server/README.md Outdated

@lucasmcdonald3 lucasmcdonald3 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for staging branch

}
}

@ParameterizedTest(name = "{displayName} for Encrypt: Java, Decrypt: {0}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth considering whether it's appropriate to test Java-decrypt here as long as this is just in the S3EC-Python repo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I think for now, I'm fine leaving it a bit loose, and when we figure out how to apply the TestServer to multiple repos, we can come up with a more robust solution.

Comment thread test-server/python-server/pyproject.toml Outdated
Comment thread test-server/OPTIMIZATION.md Outdated
Comment thread test-server/README.md
@@ -0,0 +1,61 @@
# S3EC Generalized Robust Test Framework Machine

Or G-RTFM. Or something.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love

Comment thread test-server/README.md Outdated
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import software.amazon.smithy.java.server.Server;
import software.amazon.encryption.s3.service.S3ECTestServer;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this defined? It's somewhere since the CI is passing but I can't find it, I think this is the smithy-generated shape

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which import specifically? The first two highlighted are Java stdlib and the second two are Smithy-generated.

@kessplas kessplas merged commit eb81894 into staging Sep 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants