[gnome-ostree] Output status.txt files for build and integrationtest
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-ostree] Output status.txt files for build and integrationtest
- Date: Fri, 17 May 2013 01:36:22 +0000 (UTC)
commit 60307ee02328ed01ecd092936ab204e188d8f0a9
Author: Colin Walters <walters verbum org>
Date: Thu May 16 21:35:00 2013 -0400
Output status.txt files for build and integrationtest
And show them in the IRC plugin...hopefully.
extras/supybot/GNOMEOSTree/plugin.py | 8 ++++++++
src/js/tasks/task-build.js | 10 ++++++++++
src/js/tasks/task-integrationtest.js | 2 ++
src/js/tasks/testbase.js | 28 +++++++++++++++++++++++++---
4 files changed, 45 insertions(+), 3 deletions(-)
---
diff --git a/extras/supybot/GNOMEOSTree/plugin.py b/extras/supybot/GNOMEOSTree/plugin.py
index fd0cc08..917d78d 100644
--- a/extras/supybot/GNOMEOSTree/plugin.py
+++ b/extras/supybot/GNOMEOSTree/plugin.py
@@ -93,6 +93,14 @@ class GNOMEOSTree(callbacks.Plugin):
success_str = success and 'successful' or 'failed'
millis = int(metadata['elapsedMillis'])
msg += " %s: %s in %.1f seconds. " % (taskver, success_str, millis / 1000)
+
+ status_path = os.path.join(current_task_path, 'status.txt')
+ if os.path.exists(status_path):
+ f = open(status_path)
+ status_msg = f.read().strip()
+ f.close()
+ msg += status_msg + ' '
+
msg += self._workurl + "tasks/" + taskname + "/%s/%s/output.txt" % (success_str, taskver)
if not success:
diff --git a/src/js/tasks/task-build.js b/src/js/tasks/task-build.js
index de1e13f..d940c66 100644
--- a/src/js/tasks/task-build.js
+++ b/src/js/tasks/task-build.js
@@ -689,6 +689,8 @@ const TaskBuild = new Lang.Class({
let ostreeRevision = this._saveComponentBuild(buildRef, expandedComponent, cancellable);
+ this._rebuiltComponents.push(basename);
+
return ostreeRevision;
},
@@ -992,6 +994,8 @@ const TaskBuild = new Lang.Class({
}
GSystem.shutil_rm_rf(checkoutdir, cancellable);
+
+ this._rebuiltComponents.push(basename);
this._writeComponentCache(buildname, basemeta, cancellable);
},
@@ -1023,6 +1027,8 @@ const TaskBuild = new Lang.Class({
let osname = this._snapshot.data['osname'];
this.osname = osname;
+ this._rebuiltComponents = [];
+
this.patchdir = this.workdir.get_child('patches');
let components = this._snapshot.data['components'];
@@ -1412,6 +1418,10 @@ const TaskBuild = new Lang.Class({
if (composeTreeTaskError)
throw new Error(composeTreeTaskError);
+ let statusTxtPath = Gio.File.new_for_path('status.txt');
+ statusTxtPath.replace_contents('built: ' + this._rebuiltComponents.join(' ') + '\n', null, false,
+ Gio.FileCreateFlags.REPLACE_DESTINATION, cancellable);
+
let [path, modified] = builddb.store(buildData, cancellable);
print("Build complete: " + path.get_path());
}
diff --git a/src/js/tasks/task-integrationtest.js b/src/js/tasks/task-integrationtest.js
index 139417b..dbd772d 100644
--- a/src/js/tasks/task-integrationtest.js
+++ b/src/js/tasks/task-integrationtest.js
@@ -46,6 +46,8 @@ const TaskIntegrationTest = new Lang.Class({
"0eee66bf98514369bef9868327a43cf1" // Tests failed
],
+ StatusMessageID: "4d013788dd704743b826436c951e551d",
+
CompletedTag: 'integrated',
_prepareDisk: function(mntdir, arch, cancellable) {
diff --git a/src/js/tasks/testbase.js b/src/js/tasks/testbase.js
index e05c2a0..14d46bb 100644
--- a/src/js/tasks/testbase.js
+++ b/src/js/tasks/testbase.js
@@ -37,10 +37,11 @@ const COMPLETE_IDLE_WAIT_SECONDS = 10;
const TestOneDisk = new Lang.Class({
Name: 'TestOneDisk',
- _init: function(parentTask, testRequiredMessageIds, testFailedMessageIds) {
+ _init: function(parentTask, testRequiredMessageIds, testFailedMessageIds, testStatusMessageId) {
this._parentTask = parentTask;
this._testRequiredMessageIds = testRequiredMessageIds;
this._testFailedMessageIds = testFailedMessageIds;
+ this._statusMessageId = testStatusMessageId;
},
_fail: function(message) {
@@ -97,16 +98,23 @@ const TestOneDisk = new Lang.Class({
return;
if (line) {
let data = JSON.parse(line);
+ let message = data['MESSAGE'];
let messageId = data['MESSAGE_ID'];
if (messageId) {
if (this._pendingRequiredMessageIds[messageId]) {
print("Found required message ID " + messageId);
+ print(message);
delete this._pendingRequiredMessageIds[messageId];
this._countPendingRequiredMessageIds--;
} else if (this._failMessageIds[messageId]) {
this._fail("Found failure message ID " + messageId);
+ print(message);
this._loop.quit();
}
+ if (messageId === this._statusMessageId) {
+ print(message);
+ this._parentTask._statusMessage = message;
+ }
}
if (this._countPendingRequiredMessageIds == 0 && !this._foundAllMessageIds) {
print("Found all required message IDs");
@@ -333,6 +341,8 @@ const TestBase = new Lang.Class({
RequiredMessageIDs: [],
FailedMessageIDs: [],
+ StatusMessageID: [],
+
CompletedTag: null,
_prepareDisk: function(mntdir, cancellable) {
@@ -348,6 +358,9 @@ const TestBase = new Lang.Class({
let info;
let buildJson;
let disksToTest = [];
+
+ this._statusMessage = null;
+
while ((info = e.next_file(cancellable)) != null) {
let name = info.get_name();
if (name.indexOf('build-') == 0 && JSUtil.stringEndswith(name, '.json')) {
@@ -367,10 +380,19 @@ const TestBase = new Lang.Class({
let workdirName = 'work-' + name.replace(/\.qcow2$/, '');
let subworkdir = Gio.File.new_for_path(workdirName);
GSystem.file_ensure_directory(subworkdir, true, cancellable);
- let test = new TestOneDisk(this, this.BaseRequiredMessageIDs.concat(this.RequiredMessageIDs),
- this.BaseFailedMessageIDs.concat(this.FailedMessageIDs));
+ let test = new TestOneDisk(this,
+ this.BaseRequiredMessageIDs.concat(this.RequiredMessageIDs),
+ this.BaseFailedMessageIDs.concat(this.FailedMessageIDs),
+ this.StatusMessageID);
test.execute(subworkdir, this._buildData, this.repo, currentImages.get_child(name), cancellable);
}
+
+ if (this._statusMessage != null) {
+ let statusTxtPath = Gio.File.new_for_path('status.txt');
+ statusTxtPath.replace_contents(this._statusMessage + '\n', null, false,
+ Gio.FileCreateFlags.REPLACE_DESTINATION,
cancellable);
+ }
+
let buildData = this._buildData;
if (buildJson != null && this.CompletedTag !== null) {
let refData = '';
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]