Skip to content
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

ThirdPartySyncCommand - Adding new parameters #614

Merged
merged 1 commit into from
Jul 27, 2020
Merged

ThirdPartySyncCommand - Adding new parameters #614

merged 1 commit into from
Jul 27, 2020

Conversation

comunacho
Copy link
Contributor

To implement the PULL, PUSH and PUSH_TRANSLATIONS commands in ThirdPartyService, we need to update ThirdPartySyncCommand and several dependencies to utilize these new parameters: --skip-text-units-with-pattern and --skip-assets-path-pattern.

Please note the TODO added to ThirdPartySyncCommandTest and documented in #612

webapp/pom.xml Outdated Show resolved Hide resolved
@comunacho
Copy link
Contributor Author

@aurambaj Created this new PR to merge into spring2x branch.

@@ -1,15 +1,15 @@
package com.box.l10n.mojito.cli.command;

import com.box.l10n.mojito.rest.client.ThirdPartySync;
import com.box.l10n.mojito.rest.ThirdPartySyncAction;
Copy link
Collaborator

@aurambaj aurambaj Jul 27, 2020

Choose a reason for hiding this comment

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

oh sorry, maybe I wasn't super clear last time we chatted about it. I don't want the rest client and the webservice layer to be linked closely (with webapp depending on the client). The main reason is that in most cases there is not a 1:1 mapping between what's done in the server and what makes sense in the client (hibernate entities, slightly different object). I know that in many case the POJO are or feel like duplicates between the client and server but I'd rather keep that way. Let's not have the rest client as dependency of webapp, it also becomes messy and we may end up having some code going through the client instead of directly through the service which doesn't make sense. It may become confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just updated the code


String outputString = outputCapture.toString();
assertTrue(outputString.contains(Arrays.asList(ThirdPartySync.Action.MAP_TEXTUNIT, ThirdPartySync.Action.PUSH_SCREENSHOT).toString()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not keeping that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

"-sa", skipAssetPattern,
"-o", options.get(0), options.get(1));

waitForCondition("Ensure ThirdPartySyncJob gets executed",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess that listener is ok for now though I think changing the application context is not too great if we ever start running test in parallel, etc.

So my preference would be avoiding the listener and just wait for the state (or different part of the state) to get to what we expect which would indicate a successful migration.

On top of my head I don't remember other test intercepting part of the request to perform input validation. In general those are more like end to end test. The parameters are not check directly but instead the results are checked inferring that the proper arguments were passed

Copy link
Contributor Author

@comunacho comunacho Jul 27, 2020

Choose a reason for hiding this comment

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

I've prioritized on testing that the parameters given to the CLI were passed around downstream all the way to the Quartz job for this test. I do agree that here is better to test final states or side effects, but since non of the parameters is being used in ThirdPartyTMSInMemory method we have nowadays and we're not triggering side effects, my preference for this PR was to have the argument passing fully tested (since that's what we're changing now).

Since we'll still implement new methods in ThirdPartyTMS in the upcoming PRs, I will add end to end testing through the ThirdPartyTMSInMemory class once we have these new method added to the interface signature as well as to the interface implementors (ThirdPartyTMSSmartling and ThirdPartyTMSInMemory)

@aurambaj aurambaj merged commit eb5a12c into box:spring2x Jul 27, 2020
@comunacho comunacho deleted the third-party-sync-adding-new-parameters branch July 27, 2020 21:24
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.

None yet

2 participants