Skip to content

Conversation

@raymondfeng
Copy link
Contributor

@raymondfeng raymondfeng commented Apr 2, 2020

Step 1 for #5011

Refactor test sandbox usage to use sandbox.path to access the sandbox directory as we'll create unique subdirs for different sandbox instances.

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

Cross-posting from #5016 (review):

I love the idea of changing the code to use sandbox.path. Considering that SANDBOX_PATH should not be used any more, I think our code would be much less error-prone if the constant was removed completely.

Now:

const SANDBOX_PATH = path.resolve(__dirname, '../.sandbox');
const sandbox = new TestSandbox(SANDBOX_PATH);

My proposal:

const sandbox = new TestSandbox(path.resolve(__dirname, '../.sandbox'));

@raymondfeng
Copy link
Contributor Author

@bajtos The SANDBOX constants are removed.

@raymondfeng raymondfeng requested a review from bajtos April 2, 2020 21:26
@dhmlau dhmlau added this to the April 2020 milestone Apr 2, 2020
@raymondfeng raymondfeng added the Testlab @loopback/testlab label Apr 2, 2020
@raymondfeng raymondfeng force-pushed the refine-test-sandbox-usage branch 2 times, most recently from 6d9ff7a to d67658a Compare April 2, 2020 23:16
Copy link
Member

@bajtos bajtos 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 for removing SANDBOX constants 👏 The pull request is almost ready now 🏁

@bajtos bajtos added the refactor label Apr 3, 2020
…irectory

The starting path for a sandbox is not necessarily the target directory as
we may create a unique subdir under the path to ensure sandboxes can be used
in parallel testing.
@raymondfeng raymondfeng force-pushed the refine-test-sandbox-usage branch from d67658a to 7e2ade7 Compare April 3, 2020 15:50
@raymondfeng raymondfeng merged commit 56a4696 into master Apr 3, 2020
@raymondfeng raymondfeng deleted the refine-test-sandbox-usage branch April 3, 2020 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Testlab @loopback/testlab

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants