Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cli/upload/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ func NewCommand() *cobra.Command {
uploadCommand.Flags().BoolVarP(&verify, "verify", "t", false, "Verify uploaded binary after the upload.")
uploadCommand.Flags().BoolVarP(&verbose, "verbose", "v", false, "Optional, turns on verbose mode.")

uploadCommand.MarkFlagRequired("port")

return uploadCommand
}

Expand Down
26 changes: 26 additions & 0 deletions test/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,35 @@ def test_upload(run_command, data_dir, detected_boards):
fqbn=board.fqbn, sketch_path=sketch_path
)
)
# Upload without port must fail
result = run_command(
"upload -b {fqbn} {sketch_path}".format(
sketch_path=sketch_path, fqbn=board.fqbn, port=board.address
)
)
assert result.failed
# Upload
assert run_command(
"upload -b {fqbn} -p {port} {sketch_path}".format(
sketch_path=sketch_path, fqbn=board.fqbn, port=board.address
)
)


def test_upload_after_attach(run_command, data_dir, detected_boards):
# Init the environment explicitly
assert run_command("core update-index")

for board in detected_boards:
# Download core
assert run_command("core install {}".format(board.core))
# Create a sketch
sketch_path = os.path.join(data_dir, "foo")
assert run_command("sketch new {}".format(sketch_path))
assert run_command(
"board attach serial://{port} {sketch_path}".format(port=board.address, sketch_path=sketch_path)
)
# Build sketch
assert run_command("compile {sketch_path}".format(sketch_path=sketch_path))
# Upload
assert run_command("upload {sketch_path}".format(sketch_path=sketch_path))