mirror of
https://git.cloudron.io/cloudron/gitea-app.git
synced 2024-11-25 01:21:00 +00:00
Avoid nxdomain during tests and always specify app id
This commit is contained in:
parent
d37044f8e0
commit
1b15db85e3
1 changed files with 30 additions and 13 deletions
27
test/test.js
27
test/test.js
|
@ -234,8 +234,8 @@ return done();
|
|||
|
||||
function addCustomFile(done) {
|
||||
fs.writeFileSync('/tmp/customfile.txt', 'GOGS TEST', 'utf8');
|
||||
execSync('cloudron exec -- mkdir -p /app/data/custom/public');
|
||||
execSync('cloudron push /tmp/customfile.txt /app/data/custom/public/customfile.txt');
|
||||
execSync(`cloudron exec --app ${app.id} -- mkdir -p /app/data/custom/public`);
|
||||
execSync(`cloudron push --app ${app.id} /tmp/customfile.txt /app/data/custom/public/customfile.txt`);
|
||||
fs.unlinkSync('/tmp/customfile.txt');
|
||||
done();
|
||||
}
|
||||
|
@ -351,12 +351,17 @@ return done();
|
|||
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 () {
|
||||
it('move to different location', function (done) {
|
||||
//browser.manage().deleteAllCookies(); // commented because of error "'Network.deleteCookie' wasn't found"
|
||||
// ensure we don't hit NXDOMAIN in the mean time
|
||||
browser.get('about:blank').then(function () {
|
||||
execSync('cloudron configure --wait --location ' + LOCATION + '2 --app ' + app.id, { 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');
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('can login', login);
|
||||
|
@ -365,8 +370,12 @@ return done();
|
|||
it('can clone the url', cloneRepo);
|
||||
it('file exists in repo', function () { expect(fs.existsSync(repodir + '/newfile')).to.be(true); });
|
||||
|
||||
it('uninstall app', function () {
|
||||
it('uninstall app', function (done) {
|
||||
// ensure we don't hit NXDOMAIN in the mean time
|
||||
browser.get('about:blank').then(function () {
|
||||
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
// check if the _first_ login via email succeeds
|
||||
|
@ -379,10 +388,14 @@ return done();
|
|||
|
||||
login(function (error) {
|
||||
if (error) return done(error);
|
||||
|
||||
// ensure we don't hit NXDOMAIN in the mean time
|
||||
browser.get('about:blank').then(function () {
|
||||
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// test update
|
||||
it('can install app', function () {
|
||||
|
@ -408,7 +421,11 @@ return done();
|
|||
it('can clone the url', cloneRepo);
|
||||
it('file exists in cloned repo', fileExists);
|
||||
|
||||
it('uninstall app', function () {
|
||||
it('uninstall app', function (done) {
|
||||
// ensure we don't hit NXDOMAIN in the mean time
|
||||
browser.get('about:blank').then(function () {
|
||||
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue