Skip to content

Commit 97aadbe

Browse files
authored
Marked network-sensitive tests (#90)
All tests that may fail because of network connectivitiy are now prefixed [network]. Reduced parallelism to 1, this makes them pass more often
1 parent 70cf3ba commit 97aadbe

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ watch:
77
./node_modules/.bin/gulp watch
88

99
test-only:
10-
./node_modules/.bin/nyc --check-coverage --lines 85 --branches 74 --functions 85 ./node_modules/.bin/ava --verbose --concurrency 5 test/
10+
./node_modules/.bin/nyc --check-coverage --lines 85 --branches 74 --functions 85 ./node_modules/.bin/ava --verbose --concurrency 1 test/
1111
./node_modules/.bin/nyc report --reporter=lcov
1212

1313
lint:

test/commands/install.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,27 +80,27 @@ async function getPackageVersion(config, packagePath) {
8080
path.join(config.cwd, `node_modules/${packagePath}/package.json`))).version;
8181
}
8282

83-
test("root install from shrinkwrap", () => {
83+
test("[network] root install from shrinkwrap", () => {
8484
return run({}, [], "root-install-with-lockfile");
8585
});
8686

87-
test("root install with optional deps", () => {
87+
test("[network] root install with optional deps", () => {
8888
return run({}, [], "root-install-with-optional-dependency");
8989
});
9090

91-
test("install with arg that has install scripts", () => {
91+
test("[network] install with arg that has install scripts", () => {
9292
return run({}, ["fsevents"], "install-with-arg-and-install-scripts");
9393
});
9494

95-
test("install with arg", () => {
95+
test("[network] install with arg", () => {
9696
return run({}, ["is-online"], "install-with-arg");
9797
});
9898

99-
test("install with arg that has binaries", () => {
99+
test("[network] install with arg that has binaries", () => {
100100
return run({}, ["react-native-cli"], "install-with-arg-and-bin");
101101
});
102102

103-
test("install with --save and offline mirror", () => {
103+
test("[network] install with --save and offline mirror", () => {
104104
let mirrorPath = "mirror-for-offline";
105105
return run({save: true}, ["is-array@1.0.1"], "install-with-save-offline-mirror", async (config) => {
106106

@@ -121,7 +121,7 @@ test("install with --save and offline mirror", () => {
121121
});
122122
});
123123

124-
test("install with --save and without offline mirror", () => {
124+
test("[network] install with --save and without offline mirror", () => {
125125
let mirrorPath = "mirror-for-offline";
126126
return run({save: true}, ["is-array@1.0.1"], "install-with-save-no-offline-mirror", async (config) => {
127127

@@ -375,7 +375,7 @@ test("upgrade scenario", () => {
375375
}, clean);
376376
});
377377

378-
test("upgrade scenario 2 (with sub dependencies)", async () => {
378+
test("[network] upgrade scenario 2 (with sub dependencies)", async () => {
379379
// mime-types@2.0.0 is saved in local mirror and gets updated to mime-types@2.1.11
380380
// files in mirror, fbkpm.lock, package.json and node_modules should reflect that
381381

@@ -429,7 +429,7 @@ test("upgrade scenario 2 (with sub dependencies)", async () => {
429429
});
430430
});
431431

432-
test("downgrade scenario", () => {
432+
test("[network] downgrade scenario", () => {
433433
// left-pad first installed 1.1.0 then downgraded to 0.0.9
434434
// files in mirror, fbkpm.lock, package.json and node_modules should reflect that
435435

@@ -648,7 +648,8 @@ test("uninstall should remove subdependencies", () => {
648648
});
649649

650650
// TODO https://github.com/facebook/fbkpm/issues/77
651-
test.skip("install --save should add missing deps to fbkpm and mirror (PR import scenario)", async () => {
651+
test.failing("[network] install --save should add missing deps to fbkpm and mirror (PR import scenario)",
652+
async () => {
652653
let mirrorPath = "mirror-for-offline";
653654
let fixture = "install-import-pr";
654655
let cwd = path.join(fixturesLoc, fixture);
@@ -679,7 +680,7 @@ test.skip("install --save should add missing deps to fbkpm and mirror (PR import
679680
});
680681

681682
// TODO https://github.com/facebook/fbkpm/issues/78
682-
test.skip("install --save should update a dependency to fbkpm and mirror (PR import scenario 2)",
683+
test.failing("[network] install --save should update a dependency to fbkpm and mirror (PR import scenario 2)",
683684
async () => {
684685
// mime-types@2.0.0 is saved in local mirror and gets updated to mime-types@2.1.11 via
685686
// a change in package.json,
@@ -738,7 +739,7 @@ async () => {
738739
});
739740
});
740741

741-
test("install --initMirror should add init mirror deps from package.json", async () => {
742+
test("[network] install --initMirror should add init mirror deps from package.json", async () => {
742743
let mirrorPath = "mirror-for-offline";
743744
let fixture = "install-init-mirror";
744745

@@ -764,7 +765,7 @@ test("install --initMirror should add init mirror deps from package.json", async
764765
});
765766
});
766767

767-
test("install --save with new dependency should be deterministic", async () => {
768+
test("[network] install --save with new dependency should be deterministic", async () => {
768769
// mime-types@2.0.0->mime-db@1.0.3 is saved in local mirror and is deduped
769770
// install mime-db@1.23.0 should move mime-db@1.0.3 deep into mime-types
770771

@@ -821,7 +822,7 @@ test("install --save with new dependency should be deterministic", async () => {
821822
});
822823

823824
// TODO https://github.com/facebook/fbkpm/issues/79
824-
test.skip("install --save with new dependency should be deterministic 2", async () => {
825+
test.failing("[network] install --save with new dependency should be deterministic 2", async () => {
825826
// mime-types@2.0.0->mime-db@1.0.1 is saved in local mirror and is deduped
826827
// install mime-db@1.0.3 should replace mime-db@1.0.1 in root
827828

@@ -874,7 +875,7 @@ test.skip("install --save with new dependency should be deterministic 2", async
874875
});
875876
});
876877

877-
test("install --save should ignore cache", () => {
878+
test("[network] install --save should ignore cache", () => {
878879
// left-pad@1.1.0 gets installed without --save
879880
// left-pad@1.1.0 gets installed with --save
880881
// files in mirror, fbkpm.lock, package.json and node_modules should reflect that

test/fetchers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ test("CopyFetcher.fetch", async (t) => {
5151
t.is(await fs.readFile(path.join(b, "foo")), "bar");
5252
});
5353

54-
test("GitFetcher.fetch", async (t) => {
54+
test("[network] GitFetcher.fetch", async (t) => {
5555
let dir = await mkdir("git-fetcher");
5656
let fetcher = new GitFetcher({
5757
type: "git",
@@ -63,7 +63,7 @@ test("GitFetcher.fetch", async (t) => {
6363
t.is((await fs.readJson(path.join(dir, "bower.json"))).name, "font-roboto");
6464
});
6565

66-
test("TarballFetcher.fetch", async (t) => {
66+
test("[network] TarballFetcher.fetch", async (t) => {
6767
let dir = await mkdir("tarball-fetcher");
6868
let fetcher = new TarballFetcher({
6969
type: "tarball",
@@ -76,7 +76,7 @@ test("TarballFetcher.fetch", async (t) => {
7676
});
7777

7878

79-
test("TarballFetcher.fetch", async (t) => {
79+
test("[network] TarballFetcher.fetch", async (t) => {
8080
let dir = await mkdir("tarball-fetcher");
8181
let url = "https://github.com/PolymerElements/font-roboto/archive/2fd5c7bd715a24fb5b250298a140a3ba1b71fe46.tar.gz";
8282
let fetcher = new TarballFetcher({

test/package-resolver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let path = require("path");
2020
let test = require("ava");
2121

2222
function addTest(pattern, registry = "npm") {
23-
test(`resolve ${pattern}`, async () => {
23+
test(`[network] resolve ${pattern}`, async () => {
2424
let lockfile = new Lockfile;
2525
let reporter = new reporters.NoopReporter({});
2626

0 commit comments

Comments
 (0)