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

Command sketch new do not join sketchbook path to sketch name if only sketchname is provided #396

Merged
merged 16 commits into from
Sep 11, 2019

Conversation

rsora
Copy link
Contributor

@rsora rsora commented Sep 5, 2019

This PR closes #59

This PR extends the following path logic:

  1. if a sketch name only is passed as parameter, assume that the sketch directory is the current directory
  2. If a relative path for the sketch is passed, join it with the current directory path
  3. is an absolute path for the sketch is passed, simply use it

to the sketch new command in addition to compile and upload commands

@rsora rsora marked this pull request as ready for review September 5, 2019 17:07
@rsora rsora added this to the 0.6.0 milestone Sep 6, 2019
cli/Test/Test.ino Outdated Show resolved Hide resolved
cli/sketch/new.go Show resolved Hide resolved
import pytest

from .common import running_on_ci


def test_sketch_new(run_command):
Copy link
Contributor

Choose a reason for hiding this comment

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

we should probably create a new module test_sketch.py for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Module created. Additionally, I applyied a small modification to the run_command fixture in order to have a temp working dir as a sandbox for the sketch creation e2e tests

test/test_new.py Outdated
@@ -0,0 +1,51 @@
# This file is part of arduino-cli.
Copy link
Contributor

Choose a reason for hiding this comment

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

can we name this test_sketch.py for consistency?

Copy link
Contributor

@masci masci left a comment

Choose a reason for hiding this comment

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

🚢

from test.common import running_on_ci


@pytest.mark.skipif(running_on_ci() and platform.system() == "Windows",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The e2e testing in the Github CI windows VM is temporarly disabled for the sketch new feature.
We are experiencing an odd behavior for windows VM in the test pipeline that we are not able to reproduce on a physical windows machine. The issue seems to be related to the managing of pytest temporary directories.
The test will remain disabled until a root cause is found and the fix introduced as a separate PR.

@rsora rsora merged commit 032fa05 into master Sep 11, 2019
@rsora rsora deleted the rsora/path-sketch-new branch September 11, 2019 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

arduino-cli sketch new XXX command should create project at current folder, not ~/Arduino
2 participants