Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(swc): Add Bazel tests #6933

Closed
wants to merge 2 commits into from

Conversation

realtimetodie
Copy link
Contributor

Adds an integration test that simulates a Bazel environment using symbolic links to sources.

Related

kdy1
kdy1 previously approved these changes Feb 11, 2023
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!


swc-bump:

  • dbg-swc

@kdy1 kdy1 added this to the Planned milestone Feb 11, 2023
@kdy1 kdy1 enabled auto-merge (squash) February 11, 2023 13:20
@kdy1
Copy link
Member

kdy1 commented Feb 11, 2023

Oh CI failed

@realtimetodie
Copy link
Contributor Author

This can only be merged after #6930.

Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review comment generated by auto-rebase script

auto-merge was automatically disabled February 11, 2023 18:40

Head branch was pushed to by a user without write access

Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I'm not sure if this should be treated as a valid test case.
Does tsc work in this way? I'm going to patch jsc.paths to match one of tsc soon, and I think this test case can interfere it.

panic!("Failed to create symbolic link");
};

return ();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this line

let _ = remove_file(symlink_build_path.clone());

let symlink_source_path = src_dir.join("modules");
let _ = remove_file(symlink_source_path.clone());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This clone is redundant

let _ = remove_file(symlink_build_path.clone());

let symlink_source_path = src_dir.join("modules");
let _ = remove_file(symlink_source_path.clone());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let _ = remove_file(symlink_source_path.clone());
let _ = remove_file(&symlink_source_path);

let modules_dir = test_dir.join("modules");

let symlink_build_path = test_dir.join("build");
let _ = remove_file(symlink_build_path.clone());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let _ = remove_file(symlink_build_path.clone());
let _ = remove_file(&symlink_build_path);


#[cfg(target_family = "unix")]
{
symlink(src_dir, symlink_build_path.clone()).unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

#[cfg(target_family = "unix")]
{
symlink(src_dir, symlink_build_path.clone()).unwrap();
symlink(modules_dir, symlink_source_path).unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

// unprivileged users.
#[cfg(target_os = "windows")]
{
symlink_dir(src_dir.clone(), symlink_build_path.clone()).unwrap_or_else(|_| {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@kdy1 kdy1 modified the milestones: Planned, v1.3.36 Feb 21, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants