-
Notifications
You must be signed in to change notification settings - Fork 18
API Client dpc-api integration test #2933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jdettmannnava
wants to merge
30
commits into
main
Choose a base branch
from
jd/api-integration-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
d62842f
api client integration tests working
jdettmannnava 5ac64ff
add public key tests
jdettmannnava ebc4709
skip simple cov in integration test
jdettmannnava e51c6d7
run integration tests in ci
jdettmannnava 704498b
remove other ci tests for quick check
jdettmannnava 85ec33e
fix ci-api-test
jdettmannnava f3343d9
consolidate dpc-client build
jdettmannnava 84cca84
typo
jdettmannnava a8ed34e
debug attribution not starting
jdettmannnava 4b8406c
force debug
jdettmannnava 1104b36
explicitly turn off jacoco
jdettmannnava eb616d7
unset report coverage
jdettmannnava 82c4352
allow jacoco to be false
jdettmannnava 16f4a37
now debug api
jdettmannnava d2262f6
debug
jdettmannnava 455d4a8
try to build with tests
jdettmannnava a2d3f4c
Merge branch 'main' into jd/api-integration-test
jdettmannnava 0e84b1f
try starting from ci-app
jdettmannnava 2d25c83
set correct profile
jdettmannnava 8bacbf7
add secure envs
jdettmannnava ef39fa7
change too many things at once and hope
jdettmannnava 9331740
add dpc-client-specific file for docker compose
jdettmannnava 5d3e4d3
typo
jdettmannnava 3628043
Merge branch 'main' into jd/api-integration-test
jdettmannnava 4092bda
clean up test
jdettmannnava 57b17fa
let labels
jdettmannnava 78480c8
cleanup
jdettmannnava 4e78e54
cleanup
jdettmannnava 1945a46
Put back all ci tests
jdettmannnava 27b7fe8
single-line single cmd
jdettmannnava File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| services: | ||
| dpc_api_client: | ||
| build: | ||
| context: . | ||
| dockerfile: engines/api_client/Dockerfile | ||
| image: dpc-api-client:latest | ||
| volumes: | ||
| # Mount specific directories to avoid overwriting | ||
| # precompiled assets (public/assets/) and node_modules | ||
| - "./engines/api_client:/api-client" | ||
| environment: | ||
| # Application settings | ||
| - GOLDEN_MACAROON=${GOLDEN_MACAROON} | ||
| - API_METADATA_URL=http://api:3002/api/v1 | ||
| - API_ADMIN_URL=http://api:9900 | ||
| - RUBY_YJIT_ENABLE=1 | ||
| - SKIP_SIMPLE_COV=${SKIP_SIMPLE_COV:-} | ||
| - ENV=local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| #!/bin/bash | ||
| set -Ee | ||
|
|
||
| echo "┌-------------------───────────────────────┐" | ||
| echo "│ │" | ||
| echo "│ Running API Client Gem Integration Tests |" | ||
| echo "│ │" | ||
| echo "└------------─────────-------──────────────┘" | ||
|
|
||
| # Current working directory | ||
| DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" | ||
|
|
||
| # Configure the Maven log level | ||
| export MAVEN_OPTS=-Dorg.slf4j.simpleLogger.defaultLogLevel=info | ||
|
|
||
| # Include secure environment variables | ||
| set -o allexport | ||
| [[ -f ${DIR}/ops/config/decrypted/local.env ]] && source ${DIR}/ops/config/decrypted/local.env | ||
| set +o allexport | ||
|
|
||
| # Remove jacocoReport directory | ||
| if [ -d "${DIR}/jacocoReport" ]; then | ||
| rm -r "${DIR}/jacocoReport" | ||
| fi | ||
|
|
||
| function _finally { | ||
| # don't shut it down if running on ci | ||
| if [ "$ENV" != 'github-ci' ]; then | ||
| echo "SHUTTING EVERYTHING DOWN" | ||
| docker compose -p api-client-integration-app down | ||
| docker volume rm api-client-integration-app_pgdata16 | ||
| fi | ||
| } | ||
|
|
||
| trap _finally EXIT | ||
|
|
||
| # Build the application | ||
| mvn -T 1.5C clean compile -Perror-prone -B -V -ntp -DskipTests | ||
| mvn -T 1.5C package -Pci -ntp -DskipTests | ||
|
|
||
| echo "Starting api server for end-to-end tests" | ||
| USE_BFD_MOCK=true docker compose -p api-client-integration-app up api --wait | ||
|
|
||
| echo "Starting integration tests" | ||
| GOLDEN_MACAROON=$(curl -X POST http://localhost:9903/tasks/generate-token) \ | ||
| SKIP_SIMPLE_COV=true \ | ||
| docker compose -p api-client-integration-app \ | ||
| -f docker-compose.yml -f docker-compose.api-client.yml \ | ||
| run --remove-orphans \ | ||
| --entrypoint "bundle exec rspec --order defined --tag type:integration" \ | ||
| dpc_api_client | ||
|
|
||
| echo "┌───────────-------──────────-------------──┐" | ||
| echo "│ │" | ||
| echo "│ API Client Gem Integration Tests Complete |" | ||
| echo "│ │" | ||
| echo "└────────────────────--------------------───┘" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,20 +20,27 @@ And then execute: | |
| $ bundle install | ||
| ``` | ||
|
|
||
| ## Testing | ||
| Build the docker image | ||
|
|
||
| In the api_client directory | ||
| ## Debugging and Development | ||
| To build an image, use the `make` command in the project root directory. | ||
| ```bash | ||
| $ make build | ||
|
Comment on lines
-26
to
-28
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having this here and not in the root make file was a long standing pet peeve! |
||
| make api-client | ||
| ``` | ||
|
|
||
| Run the tests until they pass | ||
|
|
||
| To ssh into a Docker container with the dpc_client code, use the `make` command in the project root directory. | ||
| ```bash | ||
| make api-client-sh | ||
| ``` | ||
| $ make test | ||
|
|
||
| ## Testing | ||
| Test using `make` commands in the project root directory. | ||
|
|
||
| ### Unit Tests | ||
| ```bash | ||
| make ci-api-client | ||
| ``` | ||
|
|
||
| Jump into the docker shell for iterative development | ||
| ### Integration tests with the API | ||
| ```bash | ||
| make ci-api-client-integration | ||
| ``` | ||
| make run | ||
| ``` | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to be a problem very shortly when the switch is made for CodeBuild to use arm64 runners (I believe happening this month due to annual pricing contracts). Either this should be updated to use arm64 or aarch64 here or in a ticket dedicated to making sure everything can build on arm64.