You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2019/07/10 08:57:25 UTC

[cordova-windows] branch master updated: refactor: split tests into suites for Windows 10 and Windows 8.1 (#349)

This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git


The following commit(s) were added to refs/heads/master by this push:
     new b236887  refactor: split tests into suites for Windows 10 and Windows 8.1 (#349)
b236887 is described below

commit b236887cca2529c1b25e32540867a84c342959f3
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Wed Jul 10 10:57:20 2019 +0200

    refactor: split tests into suites for Windows 10 and Windows 8.1 (#349)
    
    ... (to be able to disable conditionally)
    
    * refactor: split tests into "blocks" for Windows 10 and Windows 8.1
    * fix: failing tests to pending
    * feat: one more config to run where msbuilddir is explicit on 15.0
    * refactor: DO run the 8.1 tests for vs17 with MSBuild 14
---
 appveyor.yml              |   4 +
 spec/e2e/endtoend.spec.js | 358 +++++++++++++++++++++++++---------------------
 2 files changed, 197 insertions(+), 165 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index 2caf60c..b241f46 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -26,6 +26,10 @@ environment:
 
     - nodejs_version: "6"
       APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+      MSBUILDDIR: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\"
+
+    - nodejs_version: "6"
+      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
       MSBUILDDIR: "C:\\Program Files (x86)\\MSBuild\\14.0\\bin\\"
 
     - nodejs_version: "6"
diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index 0ce205d..37a6048 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -78,175 +78,203 @@ describe('Cordova create and build', function () {
         expect(fs.existsSync(path.join(buildDirectory, projectFolder))).toBe(true);
     });
 
-    // default
+    describe('Windows 10', function () {
+
+        // default
+
+        it('spec.2a should build default (win10) project', function () {
+            shell.exec(buildScriptPath + '', { silent: silent });
+            _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
+        });
+
+        // --appx
+
+        it('spec.2b should build uap (win10) project', function () {
+            shell.exec(buildScriptPath + ' --appx=uap', { silent: silent });
+            _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
+        });
+
+        it('spec.2c should build uwp (win10) project', function () {
+            shell.exec(buildScriptPath + ' --appx=uwp', { silent: silent });
+            _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
+        });
+
+        // --archs
+
+        it('spec.3a should build project for particular CPU', function () {
+            shell.exec(buildScriptPath + ' --archs=\"x64\"', { silent: silent }); /* eslint no-useless-escape : 0 */
+            _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x64_debug_Test', 'CordovaApp.Windows10_1.0.0.0_x64_debug.appx');
+        });
+
+        it('spec.4a should build project for CPUs separated by whitespaces', function () {
+            shell.exec(buildScriptPath + ' --archs=\"x64 x86 arm anycpu\"', { silent: silent }); /* eslint no-useless-escape : 0 */
+            _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x64_debug_Test', 'CordovaApp.Windows10_1.0.0.0_x64_debug.appx');
+            _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x86_debug_Test', 'CordovaApp.Windows10_1.0.0.0_x86_debug.appx');
+            _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_arm_debug_Test', 'CordovaApp.Windows10_1.0.0.0_arm_debug.appx');
+            _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
+        });
+
+        // "InProcessServer extension"
+
+        it('spec.5a should build project containing plugin with InProcessServer extension', function (done) {
+            var extensionsPluginInfo, api;
+
+            extensionsPluginInfo = new PluginInfo(extensionsPlugin);
+            api = new Api();
+            api.root = path.join(buildDirectory, projectFolder);
+            api.locations.root = path.join(buildDirectory, projectFolder);
+            api.locations.www = path.join(buildDirectory, projectFolder, 'www');
+
+            var fail = jasmine.createSpy('fail')
+                .and.callFake(function (err) {
+                    console.error(err);
+                });
+
+            api.addPlugin(extensionsPluginInfo)
+                .then(function () {
+                    shell.exec(buildScriptPath, { silent: silent });
+                    _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
+                })
+                .catch(fail)
+                .finally(function () {
+                    expect(fail).not.toHaveBeenCalled();
+                    done();
+                });
+        });
+
+        // --release --bundle
+
+        it('spec.6a should generate appxupload and appxbundle for Windows 10 project bundle release build', function () {
+            // FIXME Fails for VS 2017 on AppVeyor
+            if (process.env.APPVEYOR_BUILD_WORKER_IMAGE === 'Visual Studio 2017') {
+                pending('This test is broken for VS 2017 on AppVeyor');
+            }
+
+            shell.exec(buildScriptPath + ' --release --bundle --archs=\"x64 x86 arm\"', { silent: silent });
+            _expectExist(/.*bundle\.appxupload$/, 3);
+            _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_Test', 'CordovaApp.Windows10_1.0.0.0_x64_x86_arm.appxbundle');
+        });
+
+        // --release (non-bundle)
+
+        it('spec.7 should generate appxupload for Windows 10 project non-bundle release build', function () {
+            shell.exec(buildScriptPath + ' --release --archs=\"x64 x86 arm\"', { silent: silent });
+            _expectExist(/.*\.appxupload$/, 3);
+            // CB-12416 Should build appx in separate dirs for each architecture
+            // Should contain a subdirectory for each of the architectures
+            // These subdirectories should contain corresponding appx files
+            _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_arm_Test', 'CordovaApp.Windows10_1.0.0.0_arm.appx');
+            _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x64_Test', 'CordovaApp.Windows10_1.0.0.0_x64.appx');
+            _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x86_Test', 'CordovaApp.Windows10_1.0.0.0_x86.appx');
+        });
 
-    it('spec.2a should build default (win10) project', function () {
-        shell.exec(buildScriptPath + '', { silent: silent });
-        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
     });
 
-    // --appx
+    describe('Windows 8.1', function () {
+
+        beforeEach(function () {
+            if (process.env.APPVEYOR_BUILD_WORKER_IMAGE === 'Visual Studio 2017' && process.env.MSBUILDDIR !== 'C:\\Program Files (x86)\\MSBuild\\14.0\\bin\\') {
+                pending('Windows 8.1 builds are not supported by Visual Studio 2017: https://docs.microsoft.com/en-us/visualstudio/productinfo/vs2017-compatibility-vs#windows-store-and-windows-phone-apps');
+                /*
+                    via https://issues.apache.org/jira/browse/CB-13874
+                    > Projects for Windows Store 8.1 and 8.0, and Windows Phone 8.1 and 8.0 are not supported in this release.
+                    > To maintain these apps, continue to use Visual Studio 2015
+                */
+            }
+        });
+
+        it('spec.2d should build 8.1 win project', function () {
+            shell.exec(buildScriptPath + ' --appx=8.1-win', { silent: silent });
+            _expectExist(/.*Windows.*\.appxupload/);
+        });
+
+        it('spec.2e should build 8.1 phone project', function () {
+            shell.exec(buildScriptPath + ' --appx=8.1-phone', { silent: silent });
+            _expectExist(/.*Phone.*\.appxupload/);
+        });
+
+        it('spec.2f should build 8.1 win + phone project', function () {
+            shell.exec(buildScriptPath + ' --appx=8.1', { silent: silent });
+            _expectExist(/.*Windows.*\.appxupload/);
+            _expectExist(/.*Phone.*\.appxupload/);
+        });
+
+        // --archs
+
+        it('spec.3b should build project (8.1) for particular CPU', function () {
+            shell.exec(buildScriptPath + ' --appx=8.1 --archs=\"x64\"', { silent: silent }); /* eslint no-useless-escape : 0 */
+            _expectExist(/.*Phone.*x64.*\.appxupload/);
+            _expectExist(/.*Windows.*x64.*\.appxupload/);
+        });
+
+        it('spec.3c should build project (8.1-win) for particular CPU', function () {
+            shell.exec(buildScriptPath + ' --appx=8.1-win --archs=\"x64\"', { silent: silent }); /* eslint no-useless-escape : 0 */
+            _expectExist(/.*Windows.*x64.*\.appxupload/);
+        });
+
+        it('spec.3d should build project (8.1-phone) for particular CPU', function () {
+            shell.exec(buildScriptPath + ' --appx=8.1-phone --archs=\"x64\"', { silent: silent }); /* eslint no-useless-escape : 0 */
+            _expectExist(/.*Phone.*x64.*\.appxupload/);
+        });
+
+        it('spec.4b should build project (8.1) for CPUs separated by whitespaces', function () {
+            shell.exec(buildScriptPath + ' --appx=8.1 --archs=\"x64 x86 arm anycpu\"', { silent: silent }); /* eslint no-useless-escape : 0 */
+            _expectExist(/.*Phone.*x86.*\.appxupload/);
+            _expectExist(/.*Phone.*x64.*\.appxupload/);
+            _expectExist(/.*Phone.*arm.*\.appxupload/);
+            _expectExist(/.*Phone.*AnyCPU.*\.appxupload/i);
+            _expectExist(/.*Windows.*x64.*\.appxupload/);
+            _expectExist(/.*Windows.*x86.*\.appxupload/);
+            _expectExist(/.*Windows.*arm.*\.appxupload/);
+            _expectExist(/.*Windows.*anycpu.*\.appxupload/i);
+        });
+
+        // "InProcessServer extension"
+
+        it('spec.5b should build project (8.1) containing plugin with InProcessServer extension', function (done) {
+            var extensionsPluginInfo, api;
+
+            extensionsPluginInfo = new PluginInfo(extensionsPlugin);
+            api = new Api();
+            api.root = path.join(buildDirectory, projectFolder);
+            api.locations.root = path.join(buildDirectory, projectFolder);
+            api.locations.www = path.join(buildDirectory, projectFolder, 'www');
+
+            var fail = jasmine.createSpy('fail')
+                .and.callFake(function (err) {
+                    console.error(err);
+                });
+
+            api.addPlugin(extensionsPluginInfo)
+                .then(function () {
+                    shell.exec(buildScriptPath + ' --appx=8.1', { silent: silent });
+                    _expectExist(/.*Windows.*\.appxupload/);
+                    _expectExist(/.*Phone.*\.appxupload/);
+                })
+                .catch(fail)
+                .finally(function () {
+                    expect(fail).not.toHaveBeenCalled();
+                    done();
+                });
+        });
+
+        // --release --bundle
+
+        it('spec.6b should generate appxupload and appxbundle for Windows Phone 8.1 project bundle release build', function () {
+            shell.exec(buildScriptPath + ' --release --appx=8.1-phone --bundle --archs=\"x64 x86 arm\"', { silent: silent });
+            _expectExist(/.*bundle\.appxupload$/, 3);
+            _expectSubdirAndFileExist('CordovaApp.Phone_1.0.0.0_Test', 'CordovaApp.Phone_1.0.0.0_x64_x86_arm.appxbundle');
+        });
+
+        // --release (non-bundle)
+
+        it('spec.8 for a non-bundle case for Windows Phone 8.1 it should build appx in separate dirs for each architecture', function () {
+            shell.exec(buildScriptPath + ' --release --appx=8.1-phone --phone --archs=\"x86 arm\"', { silent: silent });
+            _expectExist(/.*\.appxupload$/, 2);
+            _expectSubdirAndFileExist('CordovaApp.Phone_1.0.0.0_arm_Test', 'CordovaApp.Phone_1.0.0.0_arm.appx');
+            _expectSubdirAndFileExist('CordovaApp.Phone_1.0.0.0_x86_Test', 'CordovaApp.Phone_1.0.0.0_x86.appx');
+        });
 
-    it('spec.2b should build uap (win10) project', function () {
-        shell.exec(buildScriptPath + ' --appx=uap', { silent: silent });
-        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
     });
 
-    it('spec.2c should build uwp (win10) project', function () {
-        shell.exec(buildScriptPath + ' --appx=uwp', { silent: silent });
-        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
-    });
-
-    it('spec.2d should build 8.1 win project', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1-win', { silent: silent });
-        _expectExist(/.*Windows.*\.appxupload/);
-    });
-
-    it('spec.2e should build 8.1 phone project', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1-phone', { silent: silent });
-        _expectExist(/.*Phone.*\.appxupload/);
-    });
-
-    it('spec.2f should build 8.1 win + phone project', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1', { silent: silent });
-        _expectExist(/.*Windows.*\.appxupload/);
-        _expectExist(/.*Phone.*\.appxupload/);
-    });
-
-    // --archs
-
-    it('spec.3a should build project for particular CPU', function () {
-        shell.exec(buildScriptPath + ' --archs=\"x64\"', { silent: silent }); /* eslint no-useless-escape : 0 */
-        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x64_debug_Test', 'CordovaApp.Windows10_1.0.0.0_x64_debug.appx');
-    });
-
-    it('spec.3b should build project (8.1) for particular CPU', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1 --archs=\"x64\"', { silent: silent }); /* eslint no-useless-escape : 0 */
-        _expectExist(/.*Phone.*x64.*\.appxupload/);
-        _expectExist(/.*Windows.*x64.*\.appxupload/);
-    });
-
-    it('spec.3c should build project (8.1-win) for particular CPU', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1-win --archs=\"x64\"', { silent: silent }); /* eslint no-useless-escape : 0 */
-        _expectExist(/.*Windows.*x64.*\.appxupload/);
-    });
-
-    it('spec.3d should build project (8.1-phone) for particular CPU', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1-phone --archs=\"x64\"', { silent: silent }); /* eslint no-useless-escape : 0 */
-        _expectExist(/.*Phone.*x64.*\.appxupload/);
-    });
-
-    it('spec.4a should build project for CPUs separated by whitespaces', function () {
-        shell.exec(buildScriptPath + ' --archs=\"x64 x86 arm anycpu\"', { silent: silent }); /* eslint no-useless-escape : 0 */
-        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x64_debug_Test', 'CordovaApp.Windows10_1.0.0.0_x64_debug.appx');
-        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x86_debug_Test', 'CordovaApp.Windows10_1.0.0.0_x86_debug.appx');
-        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_arm_debug_Test', 'CordovaApp.Windows10_1.0.0.0_arm_debug.appx');
-        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
-    });
-
-    it('spec.4b should build project (8.1) for CPUs separated by whitespaces', function () {
-        shell.exec(buildScriptPath + ' --appx=8.1 --archs=\"x64 x86 arm anycpu\"', { silent: silent }); /* eslint no-useless-escape : 0 */
-        _expectExist(/.*Phone.*x86.*\.appxupload/);
-        _expectExist(/.*Phone.*x64.*\.appxupload/);
-        _expectExist(/.*Phone.*arm.*\.appxupload/);
-        _expectExist(/.*Phone.*AnyCPU.*\.appxupload/i);
-        _expectExist(/.*Windows.*x64.*\.appxupload/);
-        _expectExist(/.*Windows.*x86.*\.appxupload/);
-        _expectExist(/.*Windows.*arm.*\.appxupload/);
-        _expectExist(/.*Windows.*anycpu.*\.appxupload/i);
-    });
-
-    // "InProcessServer extension"
-
-    it('spec.5a should build project containing plugin with InProcessServer extension', function (done) {
-        var extensionsPluginInfo, api;
-
-        extensionsPluginInfo = new PluginInfo(extensionsPlugin);
-        api = new Api();
-        api.root = path.join(buildDirectory, projectFolder);
-        api.locations.root = path.join(buildDirectory, projectFolder);
-        api.locations.www = path.join(buildDirectory, projectFolder, 'www');
-
-        var fail = jasmine.createSpy('fail')
-            .and.callFake(function (err) {
-                console.error(err);
-            });
-
-        api.addPlugin(extensionsPluginInfo)
-            .then(function () {
-                shell.exec(buildScriptPath, { silent: silent });
-                _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test', 'CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx');
-            })
-            .catch(fail)
-            .finally(function () {
-                expect(fail).not.toHaveBeenCalled();
-                done();
-            });
-    });
-
-    it('spec.5b should build project (8.1) containing plugin with InProcessServer extension', function (done) {
-        var extensionsPluginInfo, api;
-
-        extensionsPluginInfo = new PluginInfo(extensionsPlugin);
-        api = new Api();
-        api.root = path.join(buildDirectory, projectFolder);
-        api.locations.root = path.join(buildDirectory, projectFolder);
-        api.locations.www = path.join(buildDirectory, projectFolder, 'www');
-
-        var fail = jasmine.createSpy('fail')
-            .and.callFake(function (err) {
-                console.error(err);
-            });
-
-        api.addPlugin(extensionsPluginInfo)
-            .then(function () {
-                shell.exec(buildScriptPath + ' --appx=8.1', { silent: silent });
-                _expectExist(/.*Windows.*\.appxupload/);
-                _expectExist(/.*Phone.*\.appxupload/);
-            })
-            .catch(fail)
-            .finally(function () {
-                expect(fail).not.toHaveBeenCalled();
-                done();
-            });
-    });
-
-    // --release --bundle
-
-    it('spec.6a should generate appxupload and appxbundle for Windows 10 project bundle release build', function () {
-        // FIXME Fails for VS 2017 on AppVeyor
-        if (process.env.APPVEYOR_BUILD_WORKER_IMAGE === 'Visual Studio 2017') {
-            pending('This test is broken for VS 2017 on AppVeyor');
-        }
-
-        shell.exec(buildScriptPath + ' --release --bundle --archs=\"x64 x86 arm\"', { silent: silent });
-        _expectExist(/.*bundle\.appxupload$/, 3);
-        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_Test', 'CordovaApp.Windows10_1.0.0.0_x64_x86_arm.appxbundle');
-    });
-
-    it('spec.6b should generate appxupload and appxbundle for Windows Phone 8.1 project bundle release build', function () {
-        shell.exec(buildScriptPath + ' --release --appx=8.1-phone --bundle --archs=\"x64 x86 arm\"', { silent: silent });
-        _expectExist(/.*bundle\.appxupload$/, 3);
-        _expectSubdirAndFileExist('CordovaApp.Phone_1.0.0.0_Test', 'CordovaApp.Phone_1.0.0.0_x64_x86_arm.appxbundle');
-    });
-
-    // --release (non-bundle)
-
-    it('spec.7 should generate appxupload for Windows 10 project non-bundle release build', function () {
-        shell.exec(buildScriptPath + ' --release --archs=\"x64 x86 arm\"', { silent: silent });
-        _expectExist(/.*\.appxupload$/, 3);
-        // CB-12416 Should build appx in separate dirs for each architecture
-        // Should contain a subdirectory for each of the architectures
-        // These subdirectories should contain corresponding appx files
-        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_arm_Test', 'CordovaApp.Windows10_1.0.0.0_arm.appx');
-        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x64_Test', 'CordovaApp.Windows10_1.0.0.0_x64.appx');
-        _expectSubdirAndFileExist('CordovaApp.Windows10_1.0.0.0_x86_Test', 'CordovaApp.Windows10_1.0.0.0_x86.appx');
-    });
-
-    it('spec.8 for a non-bundle case for Windows Phone 8.1 it should build appx in separate dirs for each architecture', function () {
-        shell.exec(buildScriptPath + ' --release --appx=8.1-phone --phone --archs=\"x86 arm\"', { silent: silent });
-        _expectExist(/.*\.appxupload$/, 2);
-        _expectSubdirAndFileExist('CordovaApp.Phone_1.0.0.0_arm_Test', 'CordovaApp.Phone_1.0.0.0_arm.appx');
-        _expectSubdirAndFileExist('CordovaApp.Phone_1.0.0.0_x86_Test', 'CordovaApp.Phone_1.0.0.0_x86.appx');
-    });
 });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org