Skip to content

Commit

Permalink
[ANCHOR-790] Add deployment test profile (#1559)
Browse files Browse the repository at this point in the history
### Description

This adds a `deployment` test profile that points the SEP-24 interactive
UI to the reference UI so that the SEP-24 flows can be completed via the
demo walllet.

### Context

The deployments will be updated so that the SEP-24 interactive UI is
deployed. This PR updates the docker-compose setup so it also works
locally.

### Testing

- `./gradlew test`

### Documentation

N/A

### Known limitations

N/A
  • Loading branch information
philipliu authored Oct 31, 2024
1 parent 808bafa commit bb411b9
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 9 deletions.
25 changes: 25 additions & 0 deletions .run/Test Profile_ deployment.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test Profile: deployment" type="JetRunConfigurationType" folderName="Run Test Profile">
<envs>
<env name="app.enableTest" value="true" />
<env name="TEST_PROFILE_NAME" value="deployment" />
<env name="KT_REFERENCE_SERVER_CONFIG" value="service-runner/src/main/resources/config/reference-config.yaml" />
</envs>
<option name="MAIN_CLASS_NAME" value="org.stellar.anchor.platform.run_profiles.RunTestProfile" />
<module name="java-stellar-anchor-sdk.service-runner.main" />
<shortenClasspath name="ARGS_FILE" />
<extension name="net.ashald.envfile">
<option name="IS_ENABLED" value="false" />
<option name="IS_SUBST" value="false" />
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
<option name="IS_IGNORE_MISSING_FILES" value="false" />
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
<ENTRIES>
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
</ENTRIES>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
2 changes: 2 additions & 0 deletions docs/01 - Contributing/A - Development Environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ Several IntelliJ run configurations are provided to make it easier to run the pr
- `Test Profile: auth-apikey-platform`: runs the tests with the auth-apikey-platform profile.
- `Test Profile: auth-jwt-platform`: runs the tests with the auth-jwt-platform profile.
- `Test Profile: host-docker-internal`: runs the tests with the host-docker-internal profile.
- `Test Profile: deployment`: runs all servers so that all SEPs can be tested using the demo wallet.
- `Sep Server: default`: runs the SEP server locally with `default` profile.
- `Stellar Observer: default`: runs the Stellar Observer locally with `default` profile.
- `Platform Server: default`: runs the Platform server locally with `default` profile.
Expand All @@ -216,6 +217,7 @@ the `service-runner/src/main/resources/profiles` folder.
- `auth-jwt-custody`: starts the custody servers with the JWT authentication enabled.
- `auth-apikey-platform`: starts the platform servers with the API key authentication enabled.
- `auth-jwt-platform`: starts the platform servers with the JWT authentication enabled.
- `deployment`: starts all servers so that all SEPs can be tested using the demo wallet.
## Development Scenarios
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ val RequestLoggerPlugin =
}

onCallRespond { call ->
val onCallTime = call.attributes[onCallTimeKey]
val onCallReceiveTime = System.currentTimeMillis()
log.info(
"${call.request.httpMethod.value} ${call.request.local.uri} (${onCallReceiveTime - onCallTime}ms)"
)
if (call.attributes.contains(onCallTimeKey)) {
val onCallTime = call.attributes[onCallTimeKey]
val onCallReceiveTime = System.currentTimeMillis()
log.info(
"${call.request.httpMethod.value} ${call.request.local.uri} (${onCallReceiveTime - onCallTime}ms)"
)
}
}
}
2 changes: 2 additions & 0 deletions service-runner/src/main/resources/common/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ services:
- ../config:/config
environment:
KT_REFERENCE_SERVER_CONFIG: /config/reference-config.yaml
ports:
- "8091:8091"

kafka:
platform: linux/x86_64
Expand Down
8 changes: 4 additions & 4 deletions service-runner/src/main/resources/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ services:
file: common/docker-compose.yaml
service: platform
env_file:
- profiles/${TEST_PROFILE_NAME:-default}/config.env
- profiles/${TEST_PROFILE_NAME:-default}/test.env
- profiles/${TEST_PROFILE_NAME:-deployment}/config.env
- profiles/${TEST_PROFILE_NAME:-deployment}/test.env
depends_on:
- db
- kafka
Expand All @@ -17,8 +17,8 @@ services:
file: common/docker-compose.yaml
service: observer
env_file:
- profiles/${TEST_PROFILE_NAME:-default}/config.env
- profiles/${TEST_PROFILE_NAME:-default}/test.env
- profiles/${TEST_PROFILE_NAME:-deployment}/config.env
- profiles/${TEST_PROFILE_NAME:-deployment}/test.env
depends_on:
- db
- kafka
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sep24.interactive_url.base_url=http://localhost:3000
Empty file.

0 comments on commit bb411b9

Please sign in to comment.