From a03fb9225360308e0dc769df1ecad8033b70d17d Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 7 Aug 2017 11:16:29 -0700 Subject: [PATCH 1/5] Add update test --- test/test.js | 78 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 55 insertions(+), 23 deletions(-) diff --git a/test/test.js b/test/test.js index 42d6968..cfa9a5d 100755 --- a/test/test.js +++ b/test/test.js @@ -63,6 +63,14 @@ describe('Application life cycle test', function () { }, TIMEOUT).then(function () { done(); }); } + function getAppInfo() { + var inspect = JSON.parse(execSync('cloudron inspect')); + + app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0]; + + expect(app).to.be.an('object'); + } + function setAvatar(done) { browser.get('https://' + app.fqdn + '/user/settings/avatar').then(function () { return browser.findElement(by.xpath('//input[@type="file" and @name="avatar"]')).sendKeys(path.resolve(__dirname, '../logo.png')); @@ -160,7 +168,7 @@ describe('Application life cycle test', function () { }); } - function checkGitClone(done) { + function cloneRepo(done) { rimraf.sync(repodir); var env = Object.create(process.env); env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh'; @@ -168,6 +176,19 @@ describe('Application life cycle test', function () { done(); } + function pushFile(done) { + var env = Object.create(process.env); + env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh'; + execSync('touch newfile && git add newfile && git commit -a -mx && git push ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + ' master', + { env: env, cwd: repodir }); + rimraf.sync('/tmp/testrepo'); + done(); + } + + function fileExists() { + expect(fs.existsSync(repodir + '/newfile')).to.be(true); + } + xit('build app', function () { execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); }); @@ -199,14 +220,7 @@ describe('Application life cycle test', function () { execSync('cloudron install --new --wait --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); }); - it('can get app information', function () { - var inspect = JSON.parse(execSync('cloudron inspect')); - - app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0]; - - expect(app).to.be.an('object'); - }); - + it('can get app information', getAppInfo); it('can get the main page', function (done) { superagent.get('https://' + app.fqdn).end(function (error, result) { expect(error).to.be(null); @@ -226,17 +240,9 @@ describe('Application life cycle test', function () { it('displays correct clone url', checkCloneUrl); - it('can clone the url', checkGitClone); - - it('can add and push a file', function (done) { - var env = Object.create(process.env); - env.GIT_SSH = __dirname + '/git_ssh_wrapper.sh'; - execSync('touch newfile && git add newfile && git commit -a -mx && git push ssh://git@' + app.fqdn + ':29418/' + username + '/' + reponame + ' master', - { env: env, cwd: repodir }); - rimraf.sync('/tmp/testrepo'); - done(); - }); + it('can clone the url', cloneRepo); + it('can add and push a file', pushFile); it('can edit file', editFile); it('can restart app', function (done) { @@ -245,8 +251,8 @@ describe('Application life cycle test', function () { }); it('can clone the url', checkCloneUrl); - it('can clone the url', checkGitClone); - it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); }); + it('can clone the url', cloneRepo); + it('file exists in repo', fileExists); it('backup app', function () { execSync('cloudron backup create --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); @@ -257,7 +263,7 @@ describe('Application life cycle test', function () { }); it('can get avatar', checkAvatar); - it('can clone the url', checkGitClone); + it('can clone the url', cloneRepo); it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); }); it('move to different location', function () { @@ -271,7 +277,7 @@ describe('Application life cycle test', function () { it('can login', login); it('can get avatar', checkAvatar); it('displays correct clone url', checkCloneUrl); - it('can clone the url', checkGitClone); + it('can clone the url', cloneRepo); it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); }); it('uninstall app', function () { @@ -292,4 +298,30 @@ describe('Application life cycle test', function () { done(); }); }); + + // test update + it('can install app', function () { + execSync('cloudron install --new --wait --appstore-id ' + app.manifest.id + ' --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); + }); + + it('can get app information', getAppInfo); + it('can login', login); + it('can set avatar', setAvatar); + it('can get avatar', checkAvatar); + it('can add public key', addPublicKey); + it('can create repo', createRepo); + it('can clone the url', cloneRepo); + it('can add and push a file', pushFile); + + it('can update', function () { + execSync('cloudron install --wait --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); + }); + + it('can get avatar', checkAvatar); + it('can clone the url', cloneRepo); + it('file exists in cloned repo', fileExists); + + it('uninstall app', function () { + execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); + }); }); From 821c13e7eb3302f408dc5f1a8603232dac360aed Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 7 Aug 2017 11:15:31 -0700 Subject: [PATCH 2/5] restart requires --wait now --- test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index cfa9a5d..94b3940 100755 --- a/test/test.js +++ b/test/test.js @@ -246,7 +246,7 @@ describe('Application life cycle test', function () { it('can edit file', editFile); it('can restart app', function (done) { - execSync('cloudron restart'); + execSync('cloudron restart --wait'); done(); }); From 4357f4b3b9843da829f167dab011fa6e7aca670a Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 7 Aug 2017 10:53:56 -0700 Subject: [PATCH 3/5] Update to version 1.1.3 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b161917..b9cd4b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM cloudron/base:0.10.0 -ENV VERSION 1.1.2 +ENV VERSION 1.1.3 RUN apt-get update && \ apt-get install -y openssh-server && \ From 9b4fb46cf328783de69fb941488476b870228cb5 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 7 Aug 2017 11:02:46 -0700 Subject: [PATCH 4/5] Version 1.0.0 --- CHANGELOG | 4 ++++ CloudronManifest.json | 2 +- DESCRIPTION.md | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c9780e2..72a322e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,3 +9,7 @@ [0.1.3] * Updated to version 1.1.2 + +[1.0.0] +* Update to version 1.1.3 + diff --git a/CloudronManifest.json b/CloudronManifest.json index d122451..3e5307b 100644 --- a/CloudronManifest.json +++ b/CloudronManifest.json @@ -4,7 +4,7 @@ "author": "Gitea developers", "description": "file://DESCRIPTION.md", "tagline": "A painless self-hosted Git Service", - "version": "0.1.3", + "version": "1.0.0", "healthCheckPath": "/healthcheck", "httpPort": 3000, "addons": { diff --git a/DESCRIPTION.md b/DESCRIPTION.md index 6b797a4..6c673eb 100644 --- a/DESCRIPTION.md +++ b/DESCRIPTION.md @@ -1,6 +1,6 @@ Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab. The initial development have been done on Gogs but we have forked it and named it Gitea. If you want to read more about the reasons why we have done that please read [this](https://blog.gitea.io/2016/12/welcome-to-gitea/) blog post. -This app packages Gitea 1.1.2 +This app packages Gitea 1.1.3 ### Purpose From 3970139ea72d52d2a0e15c2e6bd71d7e60dfcb22 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 8 Aug 2017 14:53:40 -0700 Subject: [PATCH 5/5] Add --wait for configure --- test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index 94b3940..ce9b32f 100755 --- a/test/test.js +++ b/test/test.js @@ -268,7 +268,7 @@ describe('Application life cycle test', function () { it('move to different location', function () { browser.manage().deleteAllCookies(); - execSync('cloudron configure --location ' + LOCATION + '2', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); + execSync('cloudron configure --wait --location ' + LOCATION + '2', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); var inspect = JSON.parse(execSync('cloudron inspect')); app = inspect.apps.filter(function (a) { return a.location === LOCATION + '2'; })[0]; expect(app).to.be.an('object');