-
Notifications
You must be signed in to change notification settings - Fork 172
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
RCORE-1928 Use baasaas for baas integration tests in CI #7423
Conversation
Pull Request Test Coverage Report for Build jonathan.reams_3083Details
💛 - Coveralls |
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.
Looking really good!
return {}; | ||
} | ||
|
||
static std::string unquote_string(std::string_view possibly_quoted_string) |
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.
Can we make this a public shared utility function from sync_test_utils.hpp instead of copying it?
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.
Done.
|
||
~Baasaas() | ||
{ | ||
stop(); |
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.
Does baasaas have a TTL or something just in case our tests on PRs crash and leave a bunch of containers running?
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.
Yes, they'll get reaped automatically after about 60 minutes.
Ideally, it would be great to guarantee these get cleaned up even if the test process itself dies. Maybe we could have the setup write the container ID to a file that the evergreen task could check for in the "post" task, or something like that. Seems like this should be relatively uncommon though so I think it would be fine to just revisit this 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.
I've added a lock file to this type so it will create a file called baasaas_instance.lock
in the working directory of the tests and remove it after the instance is stopped. I also added the ability to specify a container ID so the tests can still interact with baasaas to get their base urls and stuff, but won't tear down the container if it was started manually to make this easier to work with the baasaas cli script.
{ | ||
app::Request request; | ||
request.url = util::format( | ||
"https://us-east-1.aws.data.mongodb-api.com/app/baas-container-service-autzb/endpoint/%1", api_path); |
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.
can you leave a comment about who owns this app and if there is any documentation about the endpoints?
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.
done. I've also made it so we can override this via an env variable.
@@ -977,18 +989,17 @@ tasks: | |||
test_label: objstore-local | |||
test_executable_name: "realm-object-store-tests" | |||
verbose_test_output: true | |||
disable_tests_against_baas: true | |||
- func: "check branch state" | |||
|
|||
# These are baas object store tests that run against baas running on a remote host | |||
- name: baas-integration-tests | |||
tags: [ "test_suite", "for_pull_requests", "requires_baas" ] |
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.
It is a bit confusing to have both the disable_tests_against_baas
var and requires_baas
. Can we have only one of these for clarity?
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.
Unfortunately no, requires_baas
is a tag rather than an expansion which tells evergreen which tasks to run and disable_tests_against_baas
is an expansion used in commands to tell them how to compile the object-store tests.
- func: "check branch state" | ||
|
||
# These are baas object store tests that run against baas running on a remote host | ||
- name: baas-integration-tests | ||
tags: [ "test_suite", "for_pull_requests", "requires_baas" ] | ||
exec_timeout_secs: 3600 | ||
commands: | ||
- func: "launch remote baas" |
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.
It would be nice to eventually get rid of some of the launch/wait shell scripts, but I guess we'd have to wait to port over the network tests to this as well. Is there a viable path to doing this with baasaas?
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.
Yeah, I was gonna do that in a separate PR.
Can you double check this run, it looks like a new kind of failure to me?
|
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.
LGTM once CI succeeds, or the failures are investigated and appear unrelated.
@mpobrien, I think the failure @ironage is calling out is known? i remember talking to you about |
https://jira.mongodb.org/browse/BAAS-28824 should resolve that issue - it's due to the interaction between an optimization to drop the DB when terminating sync (when there's only one app in the DB) and mongodb's restriction that you can't modify collections or indexes when DB drops are in progress. |
@ironage and @mpobrien , could I get a quick review on the last commit? I updated the |
|
||
Due to MongoDB security policies, running baas requires company issued credentials. |
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.
I think it might be worth also pointing readers to https://wiki.corp.mongodb.com/display/10GEN/%28Device+Sync%29+Using+Docker+to+run+a+BAAS+server+instance and encouraging that workflow to be used for local development (the container is identical to what you get from launching one on baasaas). Baasaas should be reserved mostly for CI tasks.
how-to-build.md
Outdated
You can tell the object-store tests to use a specific version of baas with the | ||
`BAASAAS_START_MODE` environment variable, which can either be `githash`, `patchid`, | ||
or `branch`. If you specify a start mode, you need to tell it which githash or | ||
branch name to start with via the `BAASAAS_REF_SPEC` environment variable. Ommitting |
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.
Typo: Ommitting -> Omitting
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.
LGTM
What, How & Why?
This updates the baas integration tests in CI to use baas managed via baasaas rather than spinning up an ubuntu machine via host.create.
☑️ ToDos
bindgen/spec.yml
, if public C++ API changed