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

bugfix: auto_test_package does not work on windows machines #465

Merged
merged 3 commits into from Dec 15, 2016

Conversation

Projects
None yet
4 participants
@FrancoisGuillem
Contributor

FrancoisGuillem commented Apr 25, 2016

On windows, auto_test_package does not automatically run tests when a file is changed. This is because on windows, paths may contain "/" or "".

The problem is solved by calling normalizePath.

@hadley

This comment has been minimized.

Member

hadley commented Apr 25, 2016

But where are the bad slashes coming from?

@FrancoisGuillem

This comment has been minimized.

Contributor

FrancoisGuillem commented Apr 25, 2016

file.path puts "/" but normalizePath uses only "". Since the watcher calls normalizePath, it expects to see only paths with "".

@kevinushey

This comment has been minimized.

Collaborator

kevinushey commented Apr 25, 2016

For reference:

kevinushey@Kevin-MBP-2:~/git/testthat [master]
$ ag -Q "normalizePath"
R/auto-test.R
36:  code_path <- normalizePath(code_path)
37:  test_path <- normalizePath(test_path)
45:    changed <- normalizePath(c(added, modified))
96:    changed <- normalizePath(c(added, modified))

R/source.R
34:  files <- normalizePath(sort(dir(path, pattern, full.names = TRUE)))

R/test-path.R
33:  path <- normalizePath(path)

tests/testthat/test-source_dir.R
7:  res <- source_dir(normalizePath('test_dir'), pattern = 'hello', chdir = TRUE)
13:  res <- source_dir(normalizePath('test_dir'), pattern = 'hello', chdir = FALSE)

Should these all have winslash = "/"?

@FrancoisGuillem

This comment has been minimized.

Contributor

FrancoisGuillem commented Apr 26, 2016

It could help for future developments, but I think the important thing is to always use normalizePath when manipulating paths.

@hadley

This comment has been minimized.

Member

hadley commented Jul 3, 2016

Could you please add a bullet point to NEWS?

@krlmlr krlmlr added this to the 1.0.3 milestone Jul 4, 2016

@FrancoisGuillem

This comment has been minimized.

Contributor

FrancoisGuillem commented Aug 6, 2016

Done ! Sorry for the delay.

@hadley hadley merged commit 2007a89 into r-lib:master Dec 15, 2016

3 of 4 checks passed

codecov/patch 0.00% of diff hit (target 78.59%)
Details
codecov/project 78.59% remains the same compared to 46d15da
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@hadley

This comment has been minimized.

Member

hadley commented Dec 15, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment