-
Notifications
You must be signed in to change notification settings - Fork 146
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_runner overwrites pubspec.yaml (was: How do I run the tests?) #18
Comments
Something like this should do it:
|
Thanks, will try it out. Looks like I'm missing something?
|
Here's my pubspec.lock:
Does that match what you have? |
This is missing a dependency to |
interesting. thanks for the analysis. I'll add it to the dev_dependencies. Hm, looks like my .lock file was messed up. Reverted! :) |
Oh, whoa! Looks like
|
Is the |
|
There should be no confusion about the contents of How would test_runner look into other package's tests, the symlinks are only pointing to
|
I will try |
test_runner, or the tests that it is running, are still overwriting my pubspec.yaml file.
and
|
Sorry to be a pain here, but I really appreciate your help. I wanted to submit a patch for the server, but I didn't want to do that until I could pass the tests. @mkustermann could you try a fresh checkout in a fresh directory, to see what happens?
|
On my linux machine:
|
Thanks! Hm, maybe the tests aren't cleaning up, because I'm getting an auth failure, so my directory is left in a broken state.
Could I get permissions so my tests would pass? Or, can we run the tests in a way that don't require permissions (so that anyone can run the tests) ? |
These tests are only unit tests, there are no permissions necessary AFAIK. I think I know what the issue could be. So the line in question is 29
30 Future<String> readTarballFile(String path, String name) async {
31 var result = await Process.run('tar', ['-xzf', path, name, '-O']);
32 if (result.exitCode != 0) throw 'Failed to read tarball contents.';
33
34 return result.stdout;
35 } Maybe you either have no Could you modify this code and add |
Thanks! Looks like
|
still confused why my pubspec.yaml is rewritten during the tests... maybe that's by design, and would be reset if all the tests pass? I see, the test/utils.dart is writing to app/pubspec.yaml. Maybe we should write to a different file during the tests? |
There is no such thing in See here: Future withTestPackage(Future func(List<int> tarball)) {
return withTempDirectory((String tmp) async {
var readme = new File('$tmp/README.md');
var changelog = new File('$tmp/CHANGELOG.md');
var pubspec = new File('$tmp/pubspec.yaml');
await readme.writeAsString(TestPackageReadme);
await changelog.writeAsString(TestPackageChangelog);
await pubspec.writeAsString(TestPackagePubspec);
...
}); I debugged the issue now and the reason is the following. The tests create a temporary directory fill it with all necessary files, create a tarball and then call Future<String> readTarballFile(String path, String name) async {
var result = await Process.run('tar', ['-xzf', path, name, '-O']);
if (result.exitCode != 0) throw 'Failed to read tarball contents.';
return result.stdout;
} Please notice the Hope that ends this very long discussion :) |
Thanks! Will try it out.
|
Should I just run the the individual files under test/ ? If there's a document that tells me how to test my patch, let me know and I'll give it a shot.
Thanks!
The text was updated successfully, but these errors were encountered: