mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
chore(tests): enhance e2e test logs and delay for CI
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
use std::time::Duration;
|
||||
|
||||
fn main() {
|
||||
eprintln!("running tauri v1 app...");
|
||||
let mut context = tauri::generate_context!();
|
||||
if std::env::var("TARGET").unwrap_or_default() == "nsis" {
|
||||
// /D sets the default installation directory ($INSTDIR),
|
||||
@@ -25,6 +26,7 @@ fn main() {
|
||||
}
|
||||
tauri::Builder::default()
|
||||
.setup(|app| {
|
||||
println!("current version: {}", app.package_info().version);
|
||||
let handle = app.handle();
|
||||
tauri::async_runtime::spawn(async move {
|
||||
match handle
|
||||
@@ -34,6 +36,7 @@ fn main() {
|
||||
.await
|
||||
{
|
||||
Ok(update) => {
|
||||
println!("got update {}", update.latest_version());
|
||||
if update.is_update_available() {
|
||||
if let Err(e) = update.download_and_install().await {
|
||||
println!("{e}");
|
||||
|
||||
@@ -7,11 +7,13 @@
|
||||
use tauri_plugin_updater::UpdaterExt;
|
||||
|
||||
fn main() {
|
||||
eprintln!("running tauri v2 app...");
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.plugin(tauri_plugin_updater::Builder::new().build())
|
||||
.setup(|app| {
|
||||
let handle = app.handle().clone();
|
||||
println!("current version: {}", app.package_info().version);
|
||||
tauri::async_runtime::spawn(async move {
|
||||
match handle.updater().unwrap().check().await {
|
||||
Ok(Some(update)) => {
|
||||
|
||||
@@ -490,6 +490,8 @@ fn update_app_flow<F: FnOnce(Options<'_>) -> (PathBuf, TauriVersion)>(build_app_
|
||||
vec![UPDATED_EXIT_CODE, UP_TO_DATE_EXIT_CODE]
|
||||
};
|
||||
|
||||
let ci = std::env::var("CI").map(|v| v == "true").unwrap_or_default();
|
||||
|
||||
for expected_exit_code in status_checks {
|
||||
let mut binary_cmd = if cfg!(windows) {
|
||||
Command::new(tauri_v1_fixture_dir.join("target/debug/app-updater.exe"))
|
||||
@@ -501,7 +503,7 @@ fn update_app_flow<F: FnOnce(Options<'_>) -> (PathBuf, TauriVersion)>(build_app_
|
||||
.1
|
||||
.join("Contents/MacOS/app-updater"),
|
||||
)
|
||||
} else if std::env::var("CI").map(|v| v == "true").unwrap_or_default() {
|
||||
} else if ci {
|
||||
let mut c = Command::new("xvfb-run");
|
||||
c.arg("--auto-servernum").arg(
|
||||
&bundle_paths(&tauri_v1_fixture_dir, "0.1.0")
|
||||
@@ -542,12 +544,12 @@ fn update_app_flow<F: FnOnce(Options<'_>) -> (PathBuf, TauriVersion)>(build_app_
|
||||
|
||||
let code = status.code().unwrap_or(-1);
|
||||
if code != expected_exit_code {
|
||||
panic!("failed to update app\nexpected {expected_exit_code} got {code}",);
|
||||
panic!("failed to update app\nexpected {expected_exit_code} got {code}");
|
||||
}
|
||||
|
||||
// wait for the update to be applied on Windows
|
||||
#[cfg(windows)]
|
||||
std::thread::sleep(std::time::Duration::from_secs(3));
|
||||
std::thread::sleep(std::time::Duration::from_secs(if ci { 6 } else { 3 }));
|
||||
}
|
||||
|
||||
// force Rust to rebuild the binary so it doesn't conflict with other test runs
|
||||
|
||||
Reference in New Issue
Block a user