mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Update logging and enhance .gitignore for Atlas directory
- Introduced a logging system using `tracing` and related crates to improve log management and output formatting. - Updated `.gitignore` to include the `.atlas/` directory, ensuring that log files and other generated content are not tracked by Git. - Enhanced project templates to include the new `.gitignore` settings for Atlas in various project types. These changes aim to improve logging capabilities and maintain a cleaner repository by ignoring unnecessary files.
This commit is contained in:
parent
b5583c4c1b
commit
3fd50df0b2
29 changed files with 1463 additions and 79 deletions
|
|
@ -33,7 +33,7 @@ use crate::rojo_test::io_util::{
|
|||
/// The passed in callback is where the actual test body should go. Setup and
|
||||
/// cleanup happens automatically.
|
||||
pub fn run_serve_test(test_name: &str, callback: impl FnOnce(TestServeSession, RedactionMap)) {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let mut redactions = RedactionMap::default();
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ pub fn run_syncback_test_incremental(name: &str, callback: impl FnOnce(&Path)) {
|
|||
}
|
||||
|
||||
fn run_syncback_test_impl(name: &str, incremental: bool, callback: impl FnOnce(&Path)) {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
// let working_dir = get_working_dir_path();
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ macro_rules! gen_build_tests {
|
|||
paste::item! {
|
||||
#[test]
|
||||
fn [<build_ $test_name>]() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
run_build_test(stringify!($test_name));
|
||||
}
|
||||
|
|
@ -132,7 +132,7 @@ fn snapshot_debug(snap: &librojo::InstanceSnapshot) -> String {
|
|||
fn parallel_snapshot_determinism() {
|
||||
use crate::rojo_test::io_util::SERVE_TESTS_PATH;
|
||||
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let fixture_path = Path::new(SERVE_TESTS_PATH).join("connected_scripts");
|
||||
let vfs = memofs::Vfs::new_default();
|
||||
|
|
@ -158,7 +158,7 @@ fn parallel_snapshot_determinism() {
|
|||
|
||||
#[test]
|
||||
fn parallel_snapshot_determinism_stress() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let dir = tempdir().expect("couldn't create temp dir");
|
||||
let root = dir.path();
|
||||
|
|
@ -206,7 +206,7 @@ fn parallel_snapshot_determinism_stress() {
|
|||
|
||||
#[test]
|
||||
fn parallel_snapshot_with_prefetch_cache() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let dir = tempdir().expect("couldn't create temp dir");
|
||||
let root = dir.path();
|
||||
|
|
@ -274,7 +274,7 @@ fn parallel_snapshot_with_prefetch_cache() {
|
|||
|
||||
#[test]
|
||||
fn parallel_snapshot_error_propagation() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let dir = tempdir().expect("couldn't create temp dir");
|
||||
let root = dir.path();
|
||||
|
|
@ -305,7 +305,7 @@ fn parallel_snapshot_error_propagation() {
|
|||
|
||||
#[test]
|
||||
fn overlapping_path_roots_no_duplicate_children() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let dir = tempdir().expect("couldn't create temp dir");
|
||||
let root = dir.path();
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ fn run_syncback(project_path: &Path, input_path: &Path, incremental: bool) -> bo
|
|||
/// that get replaced with standard extensions (.luau, .txt) in clean mode.
|
||||
#[test]
|
||||
fn clean_mode_removes_orphaned_files() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
// Use the sync_rules test case - it has files with custom extensions
|
||||
// that become orphaned when replaced with standard extensions
|
||||
|
|
@ -105,7 +105,7 @@ fn clean_mode_removes_orphaned_files() {
|
|||
/// Test that clean mode doesn't remove files that are being written to
|
||||
#[test]
|
||||
fn clean_mode_preserves_written_files() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
// Use the child_but_not test case
|
||||
let source_path = Path::new(SYNCBACK_TESTS_PATH)
|
||||
|
|
@ -156,7 +156,7 @@ fn clean_mode_preserves_written_files() {
|
|||
/// Test that incremental mode preserves existing file structure
|
||||
#[test]
|
||||
fn incremental_mode_preserves_structure() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
// Use the sync_rules test case - it has custom extensions
|
||||
let source_path = Path::new(SYNCBACK_TESTS_PATH)
|
||||
|
|
@ -201,7 +201,7 @@ fn incremental_mode_preserves_structure() {
|
|||
/// Test that clean mode uses fresh file extensions (not preserving old ones)
|
||||
#[test]
|
||||
fn clean_mode_uses_fresh_extensions() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
// Use the sync_rules test case - it has custom extensions
|
||||
let source_path = Path::new(SYNCBACK_TESTS_PATH)
|
||||
|
|
@ -250,7 +250,7 @@ fn clean_mode_uses_fresh_extensions() {
|
|||
/// Test that clean mode doesn't remove the project file
|
||||
#[test]
|
||||
fn clean_mode_preserves_project_file() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let source_path = Path::new(SYNCBACK_TESTS_PATH)
|
||||
.join("ignore_trees_adding")
|
||||
|
|
@ -287,7 +287,7 @@ fn clean_mode_preserves_project_file() {
|
|||
/// Test that running clean mode twice produces identical results
|
||||
#[test]
|
||||
fn clean_mode_is_idempotent() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let source_path = Path::new(SYNCBACK_TESTS_PATH)
|
||||
.join("child_but_not")
|
||||
|
|
@ -334,7 +334,7 @@ fn clean_mode_is_idempotent() {
|
|||
/// .cursor/ should be left untouched by the orphan scanner.
|
||||
#[test]
|
||||
fn clean_mode_preserves_hidden_directories() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let source_path = Path::new(SYNCBACK_TESTS_PATH)
|
||||
.join("sync_rules")
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ use crate::rojo_test::roundtrip_util::{
|
|||
/// 5. Syncback to DIR_B (completely fresh)
|
||||
/// 6. Assert DIR_A == DIR_B
|
||||
fn clean_equals_fresh(test_name: &str, mutations: &[Mutation]) {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let project_path = Path::new(BUILD_TESTS_PATH).join(test_name);
|
||||
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ fn face_distribution(dom: &WeakDom, refs: &[Ref]) -> HashMap<Option<u32>, usize>
|
|||
|
||||
#[test]
|
||||
fn syncback_matching_ufowave_textures() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let input_dom = load_input_rbxm();
|
||||
let expected_dom = load_expected_dom();
|
||||
|
|
@ -245,7 +245,7 @@ fn syncback_matching_ufowave_textures() {
|
|||
|
||||
#[test]
|
||||
fn forward_matching_ufowave_textures() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
// For forward sync: snapshots come from filesystem (sparse),
|
||||
// tree comes from Studio (full properties, simulated by rbxm).
|
||||
|
|
@ -531,7 +531,7 @@ fn parity_forward_vs_syncback() {
|
|||
|
||||
#[test]
|
||||
fn round_trip_matching_identity() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
// Load the input rbxm (simulates Studio with full properties)
|
||||
let input_dom = load_input_rbxm();
|
||||
|
|
|
|||
|
|
@ -976,7 +976,7 @@ fn ref_path_nonexistent_target_no_crash() {
|
|||
/// unrelated directories with potentially malformed files).
|
||||
#[test]
|
||||
fn non_default_project_file_tree_validation() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let mut session =
|
||||
TestServeSession::new_with_project_file("non_default_project", "named.project.json5");
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ macro_rules! roundtrip_tests {
|
|||
}
|
||||
|
||||
fn run_roundtrip_test(build_test_name: &str) {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let project_path = Path::new(BUILD_TESTS_PATH).join(build_test_name);
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ fn rbxmx_ref() {
|
|||
/// This validates that syncback output is stable and self-consistent.
|
||||
#[test]
|
||||
fn syncback_idempotency() {
|
||||
let _ = env_logger::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
// Use dedup_suffix_with_meta as it exercises slugified names + meta
|
||||
let project_path = Path::new(BUILD_TESTS_PATH).join("dedup_suffix_with_meta");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue