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

(android) allow insecure requests for test results communication #56

Closed
wants to merge 1 commit into from
Closed

(android) allow insecure requests for test results communication #56

wants to merge 1 commit into from

Conversation

zachawilson
Copy link

@zachawilson zachawilson commented Aug 27, 2021

Platforms affected

  • android

Motivation and Context

Allowing insecure (HTTP) is necessary for cordova-paramedic to work, because the cordova-plugin-test-framework scripts running in the cordova environment, need to post (HTTP PUT) test results to the local server of cordova-paramedic, awaiting the results.

To address the need for insecure (HTTP) is why plugin.xml is updated to enable both AndroidInsecureFileModeEnabled=true and android:usesCleartextTraffic=true.

Description

Updated configuration in plugin.xml of this project to allow android to make insecure (HTTP) requests.

Testing

This is a little bit roundabout because of having cordova-paramedic in the loop. Let me know if there is a better test.

  • Tested by updating my copy of cordova-paramedic to reference this patched version of cordova-plugin-test-framework this commit 973f131
    • Prior to the patch, running cordova-paramedic --platform android@10.1.0 --plugin cordova-plugin-statusbar would hang, on the step: "cordova-paramedic: waiting for test results"
    • Patched now succeeds and will output test results.
  • Here is a GitHub Actions run of cordova-plugin-statusbar against this patched version of cordova paramedic
    • The important bit is in CI.yml npm install -g SwitchCaseGroup/cordova-paramedic#ec0a7e0 where the patched cordova-paramedic is referencing this
diff --git a/lib/ParamedicApp.js b/lib/ParamedicApp.js
index 7f70920..c52706b 100644
--- a/lib/ParamedicApp.js
+++ b/lib/ParamedicApp.js
@@ -68,7 +68,7 @@ class ParamedicApp {
         pluginsManager.installPlugins(this.config.getPlugins());
         pluginsManager.installTestsForExistingPlugins();
 
-        let additionalPlugins = ['github:apache/cordova-plugin-test-framework', path.join(__dirname, '..', 'paramedic-plugin')];
+        let additionalPlugins = ['github:SwitchCaseGroup/cordova-plugin-test-framework#allow-http-for-posting-status', path.join(__dirname, '..', 'paramedic-plugin')];
 
         if (this.config.shouldUseSauce() && !this.config.getUseTunnel()) {
             additionalPlugins.push(path.join(__dirname, '..', 'event-cache-plugin'));

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@zachawilson zachawilson marked this pull request as ready for review August 27, 2021 19:47
@zachawilson
Copy link
Author

@dpogue via the cordova Slack channel I found https://github.com/erisu/cordova-paramedic/compare/feat/gh-actions

The approach that @erisu took is probably better, because this "fix" is specific to cordova-paramedic and @erisu solution was done within https://github.com/apache/cordova-paramedic

So I'm going to close this PR and try to get one opened against https://github.com/apache/cordova-paramedic directly

@zachawilson
Copy link
Author

What I was trying to do with this PR is superseded by:
apache/cordova-paramedic#215

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