sebavan 6 лет назад
Родитель
Сommit
a89345cb10

+ 26 - 0
Tools/Gulp/tasks/gulpTasks-tests.js

@@ -42,6 +42,32 @@ gulp.task("tests-validation-virtualscreen", function(done) {
 });
 
 /**
+ * Launches the KARMA validation tests in ff or virtual screen ff on travis for a quick analysis during the build.
+ */
+gulp.task("tests-validation-virtualscreenWebGL1", function(done) {
+    var kamaServerOptions = {
+        configFile: rootDir + "tests/validation/karma.conf.js",
+        singleRun: true,
+        browsers: ['Firefox'],
+        client: {
+            args: ["--disableWebGL2Support"]
+        },
+        junitReporter: {
+            outputDir: '.temp/testResults', // results will be saved as $outputDir/$browserName.xml
+            outputFile: 'ValidationTests1.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile
+            suite: 'Validation Tests WebGL1', // suite will become the package name attribute in xml testsuite element
+            useBrowserName: false, // add browser name to report and classes names
+            nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
+            classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
+            properties: {} // key value pair of properties to add to the <properties> section of the report
+        }
+    };
+
+    var server = new karmaServer(kamaServerOptions, done);
+    server.start();
+});
+
+/**
  * Launches the KARMA validation tests in browser stack for remote and cross devices validation tests.
  */
 gulp.task("tests-validation-browserstack", function(done) {

+ 36 - 9
azure-pipelines.yml

@@ -57,7 +57,7 @@ jobs:
     displayName: 'Full Lint'
 
 - job: Build
-  displayName: '4. Build'
+  displayName: '4. Build and Unit Tests'
   pool:
     vmImage: 'Ubuntu-16.04'
     demands: npm
@@ -70,9 +70,17 @@ jobs:
   - script: 'gulp typescript-all'
     workingDirectory: Tools/Gulp
     displayName: 'Typescript all'
+  - script: 'gulp tests-babylon-unit'
+    workingDirectory: Tools/Gulp
+    displayName: 'Unit Tests'
+  - task: PublishTestResults@2
+    condition: succeededOrFailed()
+    inputs:
+      testRunner: JUnit
+      testResultsFiles: '.temp/testResults/UnitTests.xml'
 
-- job: Tests
-  displayName: '5. Core Tests'
+- job: TestsWebGL1
+  displayName: '5. Validation Tests WebGL1'
   pool:
     vmImage: 'Ubuntu-16.04'
     demands: npm
@@ -85,14 +93,33 @@ jobs:
   - script: 'gulp typescript-all'
     workingDirectory: Tools/Gulp
     displayName: 'Typescript all'
-  - script: 'gulp tests-babylon-unit'
+  - script: |
+      export DISPLAY=:99
+      Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
+      sleep 3 # give xvfb some time to start
+      gulp tests-validation-virtualscreenWebGL1
     workingDirectory: Tools/Gulp
-    displayName: 'Unit Tests'
+    displayName: 'Visual Tests'
   - task: PublishTestResults@2
     condition: succeededOrFailed()
     inputs:
       testRunner: JUnit
-      testResultsFiles: '.temp/testResults/UnitTests.xml'
+      testResultsFiles: '.temp/testResults/ValidationTests1.xml'
+
+- job: TestsWebGL2
+  displayName: '6. Validation Tests WebGL2'
+  pool:
+    vmImage: 'Ubuntu-16.04'
+    demands: npm
+  steps:
+  - task: Npm@1
+    displayName: 'npm install'
+    inputs:
+      workingDir: Tools/Gulp
+      verbose: false
+  - script: 'gulp typescript-all'
+    workingDirectory: Tools/Gulp
+    displayName: 'Typescript all'
   - script: |
       export DISPLAY=:99
       Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
@@ -104,7 +131,7 @@ jobs:
     condition: succeededOrFailed()
     inputs:
       testRunner: JUnit
-      testResultsFiles: '.temp/testResults/ValidationTests.xml'
+      testResultsFiles: '.temp/testResults/ValidationTests2.xml'
   # - script: 'gulp tests-validation-browserstack'
   #   workingDirectory: Tools/Gulp
   #   displayName: 'Browser Stack Tests'
@@ -114,7 +141,7 @@ jobs:
   #     BROWSER_STACK_ACCESS_KEY: $(babylon.browserStack.userToken)
 
 - job: ModuleTests
-  displayName: '6. Module Tests'
+  displayName: '7. Module Tests'
   pool:
     vmImage: 'Ubuntu-16.04'
     demands: npm
@@ -148,7 +175,7 @@ jobs:
       testResultsFiles: '.temp/testResults/ModuleTestsWebpack.xml'
 
 - job: ViewerTests
-  displayName: '7. Viewer Tests'
+  displayName: '8. Viewer Tests'
   pool:
     vmImage: 'Ubuntu-16.04'
     demands: npm

+ 4 - 0
tests/validation/integration.js

@@ -12,6 +12,10 @@ xhr.addEventListener("load", function () {
 
         describe("Validation Tests", function () {
             before(function (done) {
+                window.disableWebGL2Support = (window.__karma__.config.args && window.__karma__.config.args.indexOf('--disableWebGL2Support') > -1) ? 
+                    true :
+                    false;
+
                 this.timeout(180000);
                 require = null;
                 BABYLONDEVTOOLS.Loader

+ 2 - 2
tests/validation/karma.conf.js

@@ -56,8 +56,8 @@ module.exports = function (config) {
 
         junitReporter: {
             outputDir: '.temp/testResults', // results will be saved as $outputDir/$browserName.xml
-            outputFile: 'ValidationTests.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile
-            suite: 'Validation Tests', // suite will become the package name attribute in xml testsuite element
+            outputFile: 'ValidationTests2.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile
+            suite: 'Validation Tests WebGL2', // suite will become the package name attribute in xml testsuite element
             useBrowserName: false, // add browser name to report and classes names
             nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
             classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element

+ 1 - 1
tests/validation/validation.js

@@ -371,7 +371,7 @@ function init() {
     canvas = document.createElement("canvas");
     canvas.className = "renderCanvas";
     document.body.appendChild(canvas);
-    engine = new BABYLON.Engine(canvas, false, { useHighPrecisionFloats: true });
+    engine = new BABYLON.Engine(canvas, false, { useHighPrecisionFloats: true, disableWebGL2Support: window.disableWebGL2Support ? true : false });
     engine.enableOfflineSupport = false;
     engine.setDitheringState(false);
 }