diff --git a/build/build/paths.yaml b/build/build/paths.yaml index ce96cb12213..0d8fa691fd3 100644 --- a/build/build/paths.yaml +++ b/build/build/paths.yaml @@ -1,5 +1,5 @@ # This file is used to generate `target//build/enso-build-/out/paths.rs`. -# Generation logic is in `ci_utils/src/paths.rs`. +# Generation logic is in `build/macros/lib/src/paths.rs`. /: .github/: @@ -89,8 +89,13 @@ test/: resources/: Factorial.enso: + target/: + native-image-args.txt: runtime/: target/: + launcher/: + target/: + native-image-args.txt: runtime-benchmarks/: bench-report.xml: lib/: @@ -98,6 +103,10 @@ parser/: generate-java/: java/: + scala/: + project-manager/: + target/: + native-image-args.txt: target/: ensogl-pack/: dist/: # Here ensogl-pack outputs its artifacts diff --git a/build/build/src/engine/context.rs b/build/build/src/engine/context.rs index 93d576a10bc..e8a8aef846b 100644 --- a/build/build/src/engine/context.rs +++ b/build/build/src/engine/context.rs @@ -216,6 +216,35 @@ impl RunContext { Ok(()) } + /// During the native-image build, the engine generates arg files. This function uploads them as + /// artifacts on the CI, so we can inspect them later. + /// Note that if something goes wrong, the native image arg files may not be present. + async fn upload_native_image_arg_files(&self) -> Result { + debug!("Uploading Native Image Arg Files"); + let engine_runner_ni_argfile = + &self.repo_root.engine.runner.target.native_image_args_txt.path; + let launcher_ni_argfile = &self.repo_root.engine.launcher.target.native_image_args_txt.path; + let project_manager_ni_argfile = + &self.repo_root.lib.scala.project_manager.target.native_image_args_txt.path; + let native_image_arg_files = [ + (engine_runner_ni_argfile, "Engine Runner native-image-args"), + (launcher_ni_argfile, "Launcher native-image-args"), + (project_manager_ni_argfile, "Project Manager native-image-args"), + ]; + for (argfile, artifact_name) in native_image_arg_files { + if argfile.exists() { + ide_ci::actions::artifacts::upload_single_file(&argfile, artifact_name).await?; + } else { + warn!( + "Native Image Arg File for {} not found at {}", + artifact_name, + argfile.display() + ); + } + } + Ok(()) + } + pub async fn build(&self) -> Result { self.prepare_build_env().await?; if ide_ci::ci::run_in_ci() { @@ -475,6 +504,8 @@ impl RunContext { // If we were running any benchmarks, they are complete by now. Upload the report. if is_in_env() { + self.upload_native_image_arg_files().await?; + for bench in &self.config.execute_benchmarks { match bench { Benchmarks::Runtime => { diff --git a/lib/scala/downloader/src/test/java/org/enso/downloader/http/HttpDownloaderTest.java b/lib/scala/downloader/src/test/java/org/enso/downloader/http/HttpDownloaderTest.java index 8db53023614..8bf5a21df4f 100644 --- a/lib/scala/downloader/src/test/java/org/enso/downloader/http/HttpDownloaderTest.java +++ b/lib/scala/downloader/src/test/java/org/enso/downloader/http/HttpDownloaderTest.java @@ -162,6 +162,9 @@ public class HttpDownloaderTest { task.addProgressListener(progressListener); var resp = task.force(); assertThat(resp.content(), containsString("Hello")); + assertThat("Done was called exactly once", doneCalls[0], is(1)); + assertThat( + "Progress reported was called at least once", progressUpdateCalls[0], greaterThan(0)); } private static class TextHandler extends SimpleHttpHandler { @@ -188,9 +191,9 @@ public class HttpDownloaderTest { } private static class BigFileHandler extends SimpleHttpHandler { - private static final long BIG_FILE_SIZE = 10 * 1024; - private static final byte[] BIG_FILE_BYTES = new byte[Math.toIntExact(BIG_FILE_SIZE)]; private static final int CHUNK_SIZE = 1024; + private static final long BIG_FILE_SIZE = 10 * CHUNK_SIZE; + private static final byte[] BIG_FILE_BYTES = new byte[Math.toIntExact(BIG_FILE_SIZE)]; static { var rnd = new Random(42);