aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cli/internal/fs/testdata
diff options
context:
space:
mode:
author简律纯 <hsiangnianian@outlook.com>2023-04-28 01:36:44 +0800
committer简律纯 <hsiangnianian@outlook.com>2023-04-28 01:36:44 +0800
commitdd84b9d64fb98746a230cd24233ff50a562c39c9 (patch)
treeb583261ef00b3afe72ec4d6dacb31e57779a6faf /cli/internal/fs/testdata
parent0b46fcd72ac34382387b2bcf9095233efbcc52f4 (diff)
downloadHydroRoll-dd84b9d64fb98746a230cd24233ff50a562c39c9.tar.gz
HydroRoll-dd84b9d64fb98746a230cd24233ff50a562c39c9.zip
Diffstat (limited to 'cli/internal/fs/testdata')
-rw-r--r--cli/internal/fs/testdata/both/package.json7
-rw-r--r--cli/internal/fs/testdata/both/turbo.json18
-rw-r--r--cli/internal/fs/testdata/correct/turbo.json49
-rw-r--r--cli/internal/fs/testdata/invalid-env-1/turbo.json8
-rw-r--r--cli/internal/fs/testdata/invalid-env-2/turbo.json8
-rw-r--r--cli/internal/fs/testdata/invalid-global-env/turbo.json11
-rw-r--r--cli/internal/fs/testdata/legacy-env/turbo.json34
-rw-r--r--cli/internal/fs/testdata/legacy-only/package.json7
8 files changed, 142 insertions, 0 deletions
diff --git a/cli/internal/fs/testdata/both/package.json b/cli/internal/fs/testdata/both/package.json
new file mode 100644
index 0000000..03534b7
--- /dev/null
+++ b/cli/internal/fs/testdata/both/package.json
@@ -0,0 +1,7 @@
+{
+ "turbo": {
+ "pipeline": {
+ "build": {}
+ }
+ }
+}
diff --git a/cli/internal/fs/testdata/both/turbo.json b/cli/internal/fs/testdata/both/turbo.json
new file mode 100644
index 0000000..721e897
--- /dev/null
+++ b/cli/internal/fs/testdata/both/turbo.json
@@ -0,0 +1,18 @@
+// mocked test comment
+{
+ "pipeline": {
+ "build": {
+ // mocked test comment
+ "dependsOn": [
+ // mocked test comment
+ "^build"
+ ],
+ "outputs": ["dist/**", ".next/**", "!dist/assets/**"],
+ "outputMode": "new-only"
+ } // mocked test comment
+ },
+ "remoteCache": {
+ "teamId": "team_id",
+ "signature": true
+ }
+}
diff --git a/cli/internal/fs/testdata/correct/turbo.json b/cli/internal/fs/testdata/correct/turbo.json
new file mode 100644
index 0000000..e22cde2
--- /dev/null
+++ b/cli/internal/fs/testdata/correct/turbo.json
@@ -0,0 +1,49 @@
+// mocked test comment
+{
+ "pipeline": {
+ "build": {
+ "experimentalPassthroughEnv": ["GITHUB_TOKEN"],
+ // mocked test comment
+ "dependsOn": [
+ // mocked test comment
+ "^build"
+ ],
+ "outputs": ["dist/**", "!dist/assets/**", ".next/**"],
+ "outputMode": "new-only"
+ }, // mocked test comment
+ "lint": {
+ "outputs": [],
+ "dependsOn": ["$MY_VAR"],
+ "cache": true,
+ "outputMode": "new-only"
+ },
+ "dev": {
+ "cache": false,
+ "outputMode": "full"
+ },
+ /* mocked test comment */
+ "publish": {
+ "outputs": ["dist/**"],
+ "inputs": [
+ /*
+ mocked test comment
+ */
+ "build/**/*"
+ ],
+ "dependsOn": [
+ /* mocked test comment */ "^publish",
+ "^build",
+ "build",
+ "admin#lint"
+ ],
+ "cache": false
+ }
+ },
+ "globalDependencies": ["some-file", "../another-dir/**", "$GLOBAL_ENV_VAR"],
+ "globlaEnv": ["SOME_VAR", "ANOTHER_VAR"],
+ "experimentalGlobalPassThroughEnv": ["AWS_SECRET_KEY"],
+ "remoteCache": {
+ "teamId": "team_id",
+ "signature": true
+ }
+}
diff --git a/cli/internal/fs/testdata/invalid-env-1/turbo.json b/cli/internal/fs/testdata/invalid-env-1/turbo.json
new file mode 100644
index 0000000..e4a6517
--- /dev/null
+++ b/cli/internal/fs/testdata/invalid-env-1/turbo.json
@@ -0,0 +1,8 @@
+{
+ "pipeline": {
+ "task1": {
+ // all invalid value
+ "env": ["$A", "$B"]
+ }
+ }
+}
diff --git a/cli/internal/fs/testdata/invalid-env-2/turbo.json b/cli/internal/fs/testdata/invalid-env-2/turbo.json
new file mode 100644
index 0000000..92eec96
--- /dev/null
+++ b/cli/internal/fs/testdata/invalid-env-2/turbo.json
@@ -0,0 +1,8 @@
+{
+ "pipeline": {
+ "task1": {
+ // Mixed values
+ "env": ["$A", "B"]
+ }
+ }
+}
diff --git a/cli/internal/fs/testdata/invalid-global-env/turbo.json b/cli/internal/fs/testdata/invalid-global-env/turbo.json
new file mode 100644
index 0000000..2ae9ff9
--- /dev/null
+++ b/cli/internal/fs/testdata/invalid-global-env/turbo.json
@@ -0,0 +1,11 @@
+{
+ // Both global declarations with duplicates
+ "globalDependencies": ["$FOO", "$BAR", "somefile.txt", "somefile.txt"],
+ // some invalid values
+ "globalEnv": ["FOO", "BAZ", "$QUX"],
+ "pipeline": {
+ "task1": {
+ "dependsOn": ["$A"]
+ }
+ }
+}
diff --git a/cli/internal/fs/testdata/legacy-env/turbo.json b/cli/internal/fs/testdata/legacy-env/turbo.json
new file mode 100644
index 0000000..6b082c4
--- /dev/null
+++ b/cli/internal/fs/testdata/legacy-env/turbo.json
@@ -0,0 +1,34 @@
+// mocked test comment
+{
+ // Both global declarations with duplicates and with
+ "globalDependencies": ["$FOO", "$BAR", "somefile.txt", "somefile.txt"],
+ "globalEnv": ["FOO", "BAZ", "QUX"],
+ "pipeline": {
+ // Only legacy declaration
+ "task1": {
+ "dependsOn": ["$A"]
+ },
+ // Only new declaration
+ "task2": {
+ "env": ["A"]
+ },
+ // Same var declared in both
+ "task3": {
+ "dependsOn": ["$A"],
+ "env": ["A"]
+ },
+ // Different vars declared in both
+ "task4": {
+ "dependsOn": ["$A"],
+ "env": ["B"]
+ },
+
+ // some edge cases
+ "task6": { "env": ["A", "B", "C"], "dependsOn": ["$D", "$E", "$F"] },
+ "task7": { "env": ["A", "B", "C"], "dependsOn": ["$A", "$B", "$C"] },
+ "task8": { "env": ["A", "B", "C"], "dependsOn": ["A", "B", "C"] },
+ "task9": { "env": [], "dependsOn": ["$A"] },
+ "task10": { "env": ["A", "A"], "dependsOn": ["$A", "$A"] },
+ "task11": { "env": ["A", "A"], "dependsOn": ["$B", "$B"] }
+ }
+}
diff --git a/cli/internal/fs/testdata/legacy-only/package.json b/cli/internal/fs/testdata/legacy-only/package.json
new file mode 100644
index 0000000..03534b7
--- /dev/null
+++ b/cli/internal/fs/testdata/legacy-only/package.json
@@ -0,0 +1,7 @@
+{
+ "turbo": {
+ "pipeline": {
+ "build": {}
+ }
+ }
+}