From 488b8175be7a61b303fd4c4fc1e37509778a3149 Mon Sep 17 00:00:00 2001 From: Kamil Kisiela Date: Tue, 3 Sep 2024 11:23:36 +0200 Subject: [PATCH] Full names --- .github/CONTRIBUTING.md | 4 ++-- .github/workflows/ci.yaml | 2 +- README.md | 8 ++++---- REPORT.md | 10 +++++----- .../.gitignore | 0 .../gateway.json | 0 gateways/apollo-router-native/install.sh | 1 + .../results.txt | 0 .../router.yaml | 0 gateways/apollo-router-native/run.sh | 2 ++ gateways/{router => apollo-router}/.gitignore | 0 gateways/{router => apollo-router}/gateway.json | 0 gateways/apollo-router/install.sh | 1 + gateways/{router => apollo-router}/results.txt | 0 gateways/{router => apollo-router}/router.yaml | 0 gateways/apollo-router/run.sh | 2 ++ gateways/{cosmo => cosmo-router}/.gitignore | 0 gateways/{cosmo => cosmo-router}/config.yaml | 0 gateways/{cosmo => cosmo-router}/gateway.json | 0 gateways/{cosmo => cosmo-router}/install.sh | 0 gateways/{cosmo => cosmo-router}/results.txt | 0 gateways/{cosmo => cosmo-router}/run.sh | 2 +- .../{cosmo => cosmo-router}/subgraphs/.gitkeep | 0 gateways/{cosmo => cosmo-router}/wgc.ts | 0 gateways/{grafbase => grafbase-gateway}/.gitignore | 0 .../{grafbase => grafbase-gateway}/gateway.json | 0 .../{grafbase => grafbase-gateway}/grafbase.toml | 0 gateways/{grafbase => grafbase-gateway}/install.sh | 0 .../{grafbase => grafbase-gateway}/results.txt | 0 gateways/{grafbase => grafbase-gateway}/run.sh | 2 +- gateways/{hive => hive-gateway}/.gitignore | 0 gateways/{hive => hive-gateway}/gateway.json | 0 gateways/{hive => hive-gateway}/install.sh | 0 gateways/{hive => hive-gateway}/results.txt | 0 gateways/{hive => hive-gateway}/run.sh | 2 +- gateways/router-native/install.sh | 1 - gateways/router-native/run.sh | 2 -- gateways/router/install.sh | 1 - gateways/router/run.sh | 2 -- makefile | 4 ++++ package-lock.json | 4 ++-- src/cli.ts | 2 +- website/index.html | 14 +++++++------- 43 files changed, 35 insertions(+), 31 deletions(-) rename gateways/{router-native => apollo-router-native}/.gitignore (100%) rename gateways/{router-native => apollo-router-native}/gateway.json (100%) create mode 100755 gateways/apollo-router-native/install.sh rename gateways/{router-native => apollo-router-native}/results.txt (100%) rename gateways/{router-native => apollo-router-native}/router.yaml (100%) create mode 100755 gateways/apollo-router-native/run.sh rename gateways/{router => apollo-router}/.gitignore (100%) rename gateways/{router => apollo-router}/gateway.json (100%) create mode 100755 gateways/apollo-router/install.sh rename gateways/{router => apollo-router}/results.txt (100%) rename gateways/{router => apollo-router}/router.yaml (100%) create mode 100755 gateways/apollo-router/run.sh rename gateways/{cosmo => cosmo-router}/.gitignore (100%) rename gateways/{cosmo => cosmo-router}/config.yaml (100%) rename gateways/{cosmo => cosmo-router}/gateway.json (100%) rename gateways/{cosmo => cosmo-router}/install.sh (100%) rename gateways/{cosmo => cosmo-router}/results.txt (100%) rename gateways/{cosmo => cosmo-router}/run.sh (55%) rename gateways/{cosmo => cosmo-router}/subgraphs/.gitkeep (100%) rename gateways/{cosmo => cosmo-router}/wgc.ts (100%) rename gateways/{grafbase => grafbase-gateway}/.gitignore (100%) rename gateways/{grafbase => grafbase-gateway}/gateway.json (100%) rename gateways/{grafbase => grafbase-gateway}/grafbase.toml (100%) rename gateways/{grafbase => grafbase-gateway}/install.sh (100%) rename gateways/{grafbase => grafbase-gateway}/results.txt (100%) rename gateways/{grafbase => grafbase-gateway}/run.sh (67%) rename gateways/{hive => hive-gateway}/.gitignore (100%) rename gateways/{hive => hive-gateway}/gateway.json (100%) rename gateways/{hive => hive-gateway}/install.sh (100%) rename gateways/{hive => hive-gateway}/results.txt (100%) rename gateways/{hive => hive-gateway}/run.sh (58%) delete mode 100755 gateways/router-native/install.sh delete mode 100755 gateways/router-native/run.sh delete mode 100755 gateways/router/install.sh delete mode 100755 gateways/router/run.sh diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 11d8a94..2625147 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -2,8 +2,8 @@ 1. Create a new directory in the `gateways` folder with the name of the new gateway. 2. Prepare the `install.sh` script that will install the necessary dependencies, the gateway itself. -3. Create the `run.sh` script that will start the gateway. See an example using [supergraph.graphql](../gateways/grafbase/run.sh) and [subgraphs information](../gateways/cosmo/run.sh). -4. Add the `gateway.json` file with the necessary information about the gateway. See an example [here](../gateways/hive/gateway.json). +3. Create the `run.sh` script that will start the gateway. See an example using [supergraph.graphql](../gateways/grafbase-gateway/run.sh) and [subgraphs information](../gateways/cosmo-router/run.sh). +4. Add the `gateway.json` file with the necessary information about the gateway. See an example [here](../gateways/hive-gateway/gateway.json). 5. The `.gitignore` should be created as well to avoid committing unnecessary files. 6. Execute `make test-[name of the gateway]` to test your gateway. 7. Run `make summary` to include your gateway in the results. diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 95bda01..d536853 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,7 +28,7 @@ jobs: run: make install - name: Test - run: npm start -- test --cwd ./gateways/hive --run-script ./run.sh --reporter tap --graphql http://127.0.0.1:4000/graphql --healthcheck http://127.0.0.1:4000/healthcheck --exit-on-fail + run: npm start -- test --cwd ./gateways/hive-gateway --run-script ./run.sh --reporter tap --graphql http://127.0.0.1:4000/graphql --healthcheck http://127.0.0.1:4000/healthcheck --exit-on-fail gateways: runs-on: ubuntu-latest diff --git a/README.md b/README.md index 907985f..94c0607 100644 --- a/README.md +++ b/README.md @@ -83,10 +83,10 @@ You can run the tests for a specific gateway by running the following command: ```bash make test-[name of the gateway] -make test-grafbase -make test-cosmo -make test-hive -make test-router +make test-grafbase-gateway +make test-cosmo-router +make test-hive-gateway +make test-apollo-router ``` ### Running a gateway for a single test suite diff --git a/REPORT.md b/REPORT.md index aa5d129..6176042 100644 --- a/REPORT.md +++ b/REPORT.md @@ -17,7 +17,7 @@ Take a closer look at the results for each gateway. You can look at the full list of tests [here](./src/test-suites/). Every test id corresponds to a directory in the `src/test-suites` folder. - + ### Hive Gateway @@ -108,7 +108,7 @@ You can look at the full list of tests [here](./src/test-suites/). Every test id
🟢🟢🟢🟢🟢🟢🟢🟢
- + ### Apollo Router @@ -290,7 +290,7 @@ You can look at the full list of tests [here](./src/test-suites/). Every test id
🟢🟢🟢🟢🟢🟢🟢🟢
- + ### Apollo Router (native QP) @@ -381,7 +381,7 @@ You can look at the full list of tests [here](./src/test-suites/). Every test id
🟢🟢🟢🟢🟢🟢🟢🟢
- + ### Cosmo Router @@ -472,7 +472,7 @@ You can look at the full list of tests [here](./src/test-suites/). Every test id
❌❌❌❌❌❌❌❌
- + ### Grafbase Gateway diff --git a/gateways/router-native/.gitignore b/gateways/apollo-router-native/.gitignore similarity index 100% rename from gateways/router-native/.gitignore rename to gateways/apollo-router-native/.gitignore diff --git a/gateways/router-native/gateway.json b/gateways/apollo-router-native/gateway.json similarity index 100% rename from gateways/router-native/gateway.json rename to gateways/apollo-router-native/gateway.json diff --git a/gateways/apollo-router-native/install.sh b/gateways/apollo-router-native/install.sh new file mode 100755 index 0000000..573d183 --- /dev/null +++ b/gateways/apollo-router-native/install.sh @@ -0,0 +1 @@ +curl -sSL https://router.apollo.dev/download/nix/v2.0.0-alpha.3 | sh diff --git a/gateways/router-native/results.txt b/gateways/apollo-router-native/results.txt similarity index 100% rename from gateways/router-native/results.txt rename to gateways/apollo-router-native/results.txt diff --git a/gateways/router-native/router.yaml b/gateways/apollo-router-native/router.yaml similarity index 100% rename from gateways/router-native/router.yaml rename to gateways/apollo-router-native/router.yaml diff --git a/gateways/apollo-router-native/run.sh b/gateways/apollo-router-native/run.sh new file mode 100755 index 0000000..539095b --- /dev/null +++ b/gateways/apollo-router-native/run.sh @@ -0,0 +1,2 @@ +npm start supergraph -- --cwd ./gateways/apollo-router-native --test $1 +./router --supergraph supergraph.graphql --config router.yaml \ No newline at end of file diff --git a/gateways/router/.gitignore b/gateways/apollo-router/.gitignore similarity index 100% rename from gateways/router/.gitignore rename to gateways/apollo-router/.gitignore diff --git a/gateways/router/gateway.json b/gateways/apollo-router/gateway.json similarity index 100% rename from gateways/router/gateway.json rename to gateways/apollo-router/gateway.json diff --git a/gateways/apollo-router/install.sh b/gateways/apollo-router/install.sh new file mode 100755 index 0000000..573d183 --- /dev/null +++ b/gateways/apollo-router/install.sh @@ -0,0 +1 @@ +curl -sSL https://router.apollo.dev/download/nix/v2.0.0-alpha.3 | sh diff --git a/gateways/router/results.txt b/gateways/apollo-router/results.txt similarity index 100% rename from gateways/router/results.txt rename to gateways/apollo-router/results.txt diff --git a/gateways/router/router.yaml b/gateways/apollo-router/router.yaml similarity index 100% rename from gateways/router/router.yaml rename to gateways/apollo-router/router.yaml diff --git a/gateways/apollo-router/run.sh b/gateways/apollo-router/run.sh new file mode 100755 index 0000000..50f4b58 --- /dev/null +++ b/gateways/apollo-router/run.sh @@ -0,0 +1,2 @@ +npm start supergraph -- --cwd ./gateways/apollo-router --test $1 +./router --supergraph supergraph.graphql --config router.yaml \ No newline at end of file diff --git a/gateways/cosmo/.gitignore b/gateways/cosmo-router/.gitignore similarity index 100% rename from gateways/cosmo/.gitignore rename to gateways/cosmo-router/.gitignore diff --git a/gateways/cosmo/config.yaml b/gateways/cosmo-router/config.yaml similarity index 100% rename from gateways/cosmo/config.yaml rename to gateways/cosmo-router/config.yaml diff --git a/gateways/cosmo/gateway.json b/gateways/cosmo-router/gateway.json similarity index 100% rename from gateways/cosmo/gateway.json rename to gateways/cosmo-router/gateway.json diff --git a/gateways/cosmo/install.sh b/gateways/cosmo-router/install.sh similarity index 100% rename from gateways/cosmo/install.sh rename to gateways/cosmo-router/install.sh diff --git a/gateways/cosmo/results.txt b/gateways/cosmo-router/results.txt similarity index 100% rename from gateways/cosmo/results.txt rename to gateways/cosmo-router/results.txt diff --git a/gateways/cosmo/run.sh b/gateways/cosmo-router/run.sh similarity index 55% rename from gateways/cosmo/run.sh rename to gateways/cosmo-router/run.sh index 8f541d2..976ebe2 100755 --- a/gateways/cosmo/run.sh +++ b/gateways/cosmo-router/run.sh @@ -1,4 +1,4 @@ -npm start subgraphs -- --cwd ./gateways/cosmo --test $1 +npm start subgraphs -- --cwd ./gateways/cosmo-router --test $1 npx tsx ./wgc.js npx wgc router compose -i compose.yaml -o config.json ./cosmo \ No newline at end of file diff --git a/gateways/cosmo/subgraphs/.gitkeep b/gateways/cosmo-router/subgraphs/.gitkeep similarity index 100% rename from gateways/cosmo/subgraphs/.gitkeep rename to gateways/cosmo-router/subgraphs/.gitkeep diff --git a/gateways/cosmo/wgc.ts b/gateways/cosmo-router/wgc.ts similarity index 100% rename from gateways/cosmo/wgc.ts rename to gateways/cosmo-router/wgc.ts diff --git a/gateways/grafbase/.gitignore b/gateways/grafbase-gateway/.gitignore similarity index 100% rename from gateways/grafbase/.gitignore rename to gateways/grafbase-gateway/.gitignore diff --git a/gateways/grafbase/gateway.json b/gateways/grafbase-gateway/gateway.json similarity index 100% rename from gateways/grafbase/gateway.json rename to gateways/grafbase-gateway/gateway.json diff --git a/gateways/grafbase/grafbase.toml b/gateways/grafbase-gateway/grafbase.toml similarity index 100% rename from gateways/grafbase/grafbase.toml rename to gateways/grafbase-gateway/grafbase.toml diff --git a/gateways/grafbase/install.sh b/gateways/grafbase-gateway/install.sh similarity index 100% rename from gateways/grafbase/install.sh rename to gateways/grafbase-gateway/install.sh diff --git a/gateways/grafbase/results.txt b/gateways/grafbase-gateway/results.txt similarity index 100% rename from gateways/grafbase/results.txt rename to gateways/grafbase-gateway/results.txt diff --git a/gateways/grafbase/run.sh b/gateways/grafbase-gateway/run.sh similarity index 67% rename from gateways/grafbase/run.sh rename to gateways/grafbase-gateway/run.sh index d39d5a1..a98ad7d 100755 --- a/gateways/grafbase/run.sh +++ b/gateways/grafbase-gateway/run.sh @@ -1,2 +1,2 @@ -npm start supergraph -- --cwd ./gateways/grafbase --test $1 +npm start supergraph -- --cwd ./gateways/grafbase-gateway --test $1 __GRAFBASE_RUST_LOG=engine_v2=trace ./grafbase-gateway --schema supergraph.graphql --listen-address 127.0.0.1:4000 -c grafbase.toml --log trace \ No newline at end of file diff --git a/gateways/hive/.gitignore b/gateways/hive-gateway/.gitignore similarity index 100% rename from gateways/hive/.gitignore rename to gateways/hive-gateway/.gitignore diff --git a/gateways/hive/gateway.json b/gateways/hive-gateway/gateway.json similarity index 100% rename from gateways/hive/gateway.json rename to gateways/hive-gateway/gateway.json diff --git a/gateways/hive/install.sh b/gateways/hive-gateway/install.sh similarity index 100% rename from gateways/hive/install.sh rename to gateways/hive-gateway/install.sh diff --git a/gateways/hive/results.txt b/gateways/hive-gateway/results.txt similarity index 100% rename from gateways/hive/results.txt rename to gateways/hive-gateway/results.txt diff --git a/gateways/hive/run.sh b/gateways/hive-gateway/run.sh similarity index 58% rename from gateways/hive/run.sh rename to gateways/hive-gateway/run.sh index 38e35f7..3cf4442 100755 --- a/gateways/hive/run.sh +++ b/gateways/hive-gateway/run.sh @@ -1,2 +1,2 @@ -npm start supergraph -- --cwd ./gateways/hive --test $1 +npm start supergraph -- --cwd ./gateways/hive-gateway --test $1 npx --yes @graphql-hive/gateway@0.1.1 supergraph supergraph.graphql --port 4000 --fork 1 diff --git a/gateways/router-native/install.sh b/gateways/router-native/install.sh deleted file mode 100755 index 73cee06..0000000 --- a/gateways/router-native/install.sh +++ /dev/null @@ -1 +0,0 @@ -curl -sSL https://router.apollo.dev/download/nix/v1.53.0 | sh diff --git a/gateways/router-native/run.sh b/gateways/router-native/run.sh deleted file mode 100755 index baa0588..0000000 --- a/gateways/router-native/run.sh +++ /dev/null @@ -1,2 +0,0 @@ -npm start supergraph -- --cwd ./gateways/router-native --test $1 -./router --supergraph supergraph.graphql --config router.yaml \ No newline at end of file diff --git a/gateways/router/install.sh b/gateways/router/install.sh deleted file mode 100755 index 73cee06..0000000 --- a/gateways/router/install.sh +++ /dev/null @@ -1 +0,0 @@ -curl -sSL https://router.apollo.dev/download/nix/v1.53.0 | sh diff --git a/gateways/router/run.sh b/gateways/router/run.sh deleted file mode 100755 index c77a69c..0000000 --- a/gateways/router/run.sh +++ /dev/null @@ -1,2 +0,0 @@ -npm start supergraph -- --cwd ./gateways/router --test $1 -./router --supergraph supergraph.graphql --config router.yaml \ No newline at end of file diff --git a/makefile b/makefile index f0a5d95..57ca296 100644 --- a/makefile +++ b/makefile @@ -19,6 +19,7 @@ run-$(1): npm start -- start --test $(TEST_SUITE) --cwd ./gateways/$(1) --run-script ./run.sh --graphql $(shell jq -r .graphql ./gateways/$(1)/gateway.json) --healthcheck $(shell jq -r .health ./gateways/$(1)/gateway.json) endef +# Install all dependencies of the project and the gateways install: npm install @for dir in ./gateways/*; do \ @@ -29,6 +30,7 @@ install: fi; \ done +# Start only the subgraphs, no gateway subgraphs: npm start -- serve @@ -37,7 +39,9 @@ $(foreach gateway,$(GATEWAY_IDS),$(eval $(call TEST_GATEWAY,$(gateway)))) $(foreach gateway,$(GATEWAY_IDS),$(eval $(call RUN_GATEWAY,$(gateway)))) $(foreach gateway,$(GATEWAY_IDS),$(eval $(call TEST_SUITE_GATEWAY,$(gateway)))) +# Run the tests for all gateways test-all: $(addprefix test-,$(GATEWAY_IDS)) summary +# Update the report summary: npm run summary \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ec91796..1258e0b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "graphql-federation-audit", + "name": "graphql-federation-gateway-audit", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "graphql-federation-audit", + "name": "graphql-federation-gateway-audit", "version": "1.0.0", "license": "MIT", "dependencies": { diff --git a/src/cli.ts b/src/cli.ts index 9774219..66ef1bc 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -390,7 +390,7 @@ yargs(hideBin(process.argv)) result: Array<"." | "X">; }> = []; - process.stdout.write("Running " + ids.length + " tests\n"); + process.stdout.write("Running " + ids.length + " test suites\n"); if (!existsSync(resolvePath(argv, "./logs"))) { mkdirSync(resolvePath(argv, "./logs")); diff --git a/website/index.html b/website/index.html index d171066..6d60e25 100644 --- a/website/index.html +++ b/website/index.html @@ -222,7 +222,7 @@

View report @@ -252,7 +252,7 @@

View report @@ -312,7 +312,7 @@

View report @@ -342,7 +342,7 @@

View report @@ -372,7 +372,7 @@

View report @@ -516,8 +516,8 @@

href="https://the-guild.dev/graphql/mesh" title="GraphQL Federation Gateway" >GraphQL Mesh (now Hive Gateway) - and + > + (now Hive Gateway) and