Skip to content

Commit

Permalink
feat: bring back package version in report but will be replaced soon
Browse files Browse the repository at this point in the history
  • Loading branch information
255doesnotexist committed Aug 25, 2024
1 parent 5ed367e commit cafe378
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/test_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ impl TestRunner for LocalTestRunner {
let mut all_tests_passed = true;
let mut test_results = Vec::new();

let pkgver_tmpfile = format!("{}/pkgver", REMOTE_TMP_DIR);

for script in script_manager?.get_test_scripts() {
let output = Command::new("bash")
.arg("-c")
.arg(&format!("source {}", script))
.arg(&format!("source {} && echo -n $PACKAGE_VERSION > {}", script, pkgver_tmpfile))
.stdout(if self.verbose {
Stdio::inherit()
} else {
Expand All @@ -64,13 +66,15 @@ impl TestRunner for LocalTestRunner {
});
}

let package_version = read_to_string(&pkgver_tmpfile)?;

let report = Report {
distro: distro.to_string(),
os_version,
kernel_version,
package_name: package.to_string(),
package_type: String::from("package"),
package_version: String::new(), // partially removed
package_version: package_version, // partially removed
// TODO: add a metadata.sh script for every package
// which generate a metadata.json file containing package version
// and other metadata (different distros / packages have really different
Expand Down Expand Up @@ -242,7 +246,6 @@ impl TestRunner for RemoteTestRunner {

let pkgver_tmpfile = format!("{}/pkgver", REMOTE_TMP_DIR);
for script in script_manager?.get_test_scripts() {

let result = self.run_command(
&sess,
&format!("source {} && echo -n $PACKAGE_VERSION > {}", script, pkgver_tmpfile),
Expand Down

0 comments on commit cafe378

Please sign in to comment.