cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vladimir-kotikov <...@git.apache.org>
Subject [GitHub] cordova-android pull request: CB-9831 CB-9835 CB-9932 Added e2e te...
Date Tue, 10 Nov 2015 10:49:02 GMT
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/238#discussion_r44392722
  
    --- Diff: spec/e2e/update.spec.js ---
    @@ -0,0 +1,96 @@
    +/*
    + Licensed to the Apache Software Foundation (ASF) under one
    + or more contributor license agreements.  See the NOTICE file
    + distributed with this work for additional information
    + regarding copyright ownership.  The ASF licenses this file
    + to you under the Apache License, Version 2.0 (the
    + "License"); you may not use this file except in compliance
    + with the License.  You may obtain a copy of the License at
    +
    + http://www.apache.org/licenses/LICENSE-2.0
    +
    + Unless required by applicable law or agreed to in writing,
    + software distributed under the License is distributed on an
    + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + KIND, either express or implied.  See the License for the
    + specific language governing permissions and limitations
    + under the License.
    + */
    +
    +var actions      = require('./helpers/projectActions.js'),
    +    shell        = require('shelljs'),
    +    fs           = require('fs'),
    +    platformOld  = { version: '4.0.0', path: 'cordova-android-old' },
    +    platformEdge = { version: getCurrentVersion(), path: '.' };
    +
    +var DOWNLOAD_TIMEOUT = 2 * 60 * 1000,
    +    UPDATE_TIMEOUT   = 30 * 1000,
    +    PLATFORM_GIT_URL = 'https://github.com/apache/cordova-android';
    +
    +function getCurrentVersion() {
    +    return fs.readFileSync('VERSION').toString().trim();
    +}
    +
    +function testUpdate(projectname, projectid, createfrom, updatefrom, doBuild, done) {
    +    actions.createProject(projectname, projectid, createfrom.path, function (error) {
    +        expect(error).toBe(null);
    +        actions.updateProject(projectid, updatefrom.path, function (error) {
    +            expect(error).toBe(null);
    +            actions.getPlatformVersion(projectid, function (v) {
    +                expect(v).toEqual(updatefrom.version);
    +                if (doBuild) {
    +                    actions.buildProject(projectid, function (error) {
    +                        expect(error).toBe(null);
    +                        actions.removeProject(projectid);
    +                        done();
    +                    });
    +                } else {
    +                    actions.removeProject(projectid);
    +                    done();
    +                }
    +            });
    +        });
    +    });
    +}
    +
    +describe('preparing fixtures', function () {
    +
    +    it('cloning old platform', function (done) {
    +        shell.rm('-rf', platformOld.path);
    +        shell.exec('git clone ' + PLATFORM_GIT_URL + ' ' + platformOld.path + 
    --- End diff --
    
    I would use `--branch` option to checkout specific branch instead od doing this manually.
Also `--depth` option decreased test time dramatically. This might not work in future, when
we'll test multiple upgrade/downgrade variants (though `--no-single-branch` might help), but
for now i'd prefer to have `--depth 1` enabled.
     
    ```javascript
    var command = util.format('git clone %s --depth=1 --branch %s --single-branch %s',
        PLATFORM_GIT_URL, platformOld.version, platformOld.path);
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message