From a77b6e151d35f1dee9b5e7b2e2f7383c8dd14b3d Mon Sep 17 00:00:00 2001 From: Sebastian Urchs Date: Fri, 3 May 2024 16:24:49 -0400 Subject: [PATCH 1/4] [FIX] the simple test --- cypress/e2e/{simple-test.js => simple-test.cy.js} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename cypress/e2e/{simple-test.js => simple-test.cy.js} (91%) diff --git a/cypress/e2e/simple-test.js b/cypress/e2e/simple-test.cy.js similarity index 91% rename from cypress/e2e/simple-test.js rename to cypress/e2e/simple-test.cy.js index e7dab8e..8498cfb 100644 --- a/cypress/e2e/simple-test.js +++ b/cypress/e2e/simple-test.cy.js @@ -14,7 +14,7 @@ describe('Full stack e2e', () => { }); }); it("Federation API", () => { - cy.request("localhost:8000/query/?node=local graph 1").as("query"); + cy.request("localhost:8080/query/?node=http://api:8000/").as("query"); cy.get("@query").should((response) => { expect(response.status).to.eq(200); }); From 4aa5324d1662813fd2e64499fb9e533815cb5fb9 Mon Sep 17 00:00:00 2001 From: Sebastian Urchs Date: Fri, 3 May 2024 16:30:23 -0400 Subject: [PATCH 2/4] [REF] Put both compatibility tests in one And fix the run setup --- .../workflows/compatibility-test copy.yaml | 55 -------- .github/workflows/compatibility-test.yaml | 48 ------- .github/workflows/compatibility.yaml | 126 ++++++++++++++++++ 3 files changed, 126 insertions(+), 103 deletions(-) delete mode 100644 .github/workflows/compatibility-test copy.yaml delete mode 100644 .github/workflows/compatibility-test.yaml create mode 100644 .github/workflows/compatibility.yaml diff --git a/.github/workflows/compatibility-test copy.yaml b/.github/workflows/compatibility-test copy.yaml deleted file mode 100644 index 1c7cff8..0000000 --- a/.github/workflows/compatibility-test copy.yaml +++ /dev/null @@ -1,55 +0,0 @@ -name: Check compatibility of latest - -on: - schedule: - # * is a special character in YAML so you have to quote this string - - cron: '31 5,17 * * *' - workflow_dispatch: - -jobs: - Neurobagel-latest: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Rename files - working-directory: . - run: | - cp template.env .env - cp local_nb_nodes.template.json local_nb_nodes.json - - - name: Run docker compose - working-directory: . - run: | - docker compose --profile full_stack up -d - - - name: Set up node env - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Install cypress - run: npm install - - - name: wait for graph set up - working-directory: ./scripts - run: | - while ! tail -n 0 -f ./logs/DEPLOY.log | grep -q "Finished setting up the Neurobagel graph backend."; do - : - done - echo "Finished setting up the Neurobagel graph backend." - - - name: Run end to end tests - uses: cypress-io/github-action@v6 - with: - wait-on: http://localhost:3000 - component: false - - - name: Latest broke, tell someone - if: ${{ failure() }} - run: | - curl -X POST -H 'Content-type: application/json' --data '{"text":"Neurobagel latest broke! Please check https://github.com/neurobagel/recipes/actions and resolve the incompatible versions!"}' ${{ secrets.NB_SLACK_WEBHOOK }} - - diff --git a/.github/workflows/compatibility-test.yaml b/.github/workflows/compatibility-test.yaml deleted file mode 100644 index e7c6acc..0000000 --- a/.github/workflows/compatibility-test.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: compatibility tests - -on: - workflow_dispatch: - -jobs: - Compatibility-test: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Rename files - working-directory: . - run: | - cp template.env .env - cp local_nb_nodes.template.json local_nb_nodes.json - sed -i 's/latest/nightly/g' .env - - - name: Run docker compose - working-directory: . - run: | - docker compose --profile full_stack up -d - - - name: Set up node env - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Install cypress - run: npm install - - - name: wait for graph set up - working-directory: ./scripts - run: | - while ! tail -n 0 -f ./logs/DEPLOY.log | grep -q "Finished setting up the Neurobagel graph backend."; do - : - done - echo "Finished setting up the Neurobagel graph backend." - - - name: Run end to end tests - uses: cypress-io/github-action@v6 - with: - wait-on: http://localhost:3000 - component: false - - diff --git a/.github/workflows/compatibility.yaml b/.github/workflows/compatibility.yaml new file mode 100644 index 0000000..ccc0d19 --- /dev/null +++ b/.github/workflows/compatibility.yaml @@ -0,0 +1,126 @@ +name: Compatibility of + +on: + workflow_dispatch: + schedule: + - cron: '21 5,17 * * *' + +jobs: + latest: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Rename files + working-directory: . + run: | + cp template.env .env + cp local_nb_nodes.template.json local_nb_nodes.json + sed -i 's/latest/nightly/g' .env + + - name: Run docker compose + working-directory: . + run: | + docker compose --profile full_stack up -d + + - name: Set up node env + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install cypress + run: npm install + + - name: wait for graph set up + working-directory: ./scripts + run: | + # The logs are written at the end of the setup at the moment, so we have to wait for the file to exist + while [ ! -f ./logs/DEPLOY.log ]; do + : + done + # Once the file is there, we want to wait for the message that the setup is done + echo "We think the file exists now!" + while ! tail -n 0 -f ./logs/DEPLOY.log | grep -q "Finished setting up the Neurobagel graph backend."; do + : + done + echo "Finished setting up the Neurobagel graph backend." + + - name: Run end to end tests + uses: cypress-io/github-action@v6 + with: + wait-on: http://localhost:3000 + component: false + + - name: Clean up again + working-directory: . + run: | + docker compose --profile full_stack down + + - name: Latest broke, tell someone + if: ${{ failure() }} + run: | + curl -X POST -H 'Content-type: application/json' --data '{"text":"Neurobagel latest broke! Please check https://github.com/neurobagel/recipes/actions and resolve the incompatible versions!"}' ${{ secrets.NB_SLACK_WEBHOOK }} + + - name: Clean up again + working-directory: . + run: | + docker compose --profile full_stack down + + nightly: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Rename files + working-directory: . + run: | + cp template.env .env + cp local_nb_nodes.template.json local_nb_nodes.json + sed -i 's/latest/nightly/g' .env + + - name: Run docker compose + working-directory: . + run: | + docker compose --profile full_stack up -d + + - name: Set up node env + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install cypress + run: npm install + + - name: wait for graph set up + working-directory: ./scripts + run: | + # The logs are written at the end of the setup at the moment, so we have to wait for the file to exist + while [ ! -f ./logs/DEPLOY.log ]; do + : + done + # Once the file is there, we want to wait for the message that the setup is done + echo "We think the file exists now!" + while ! tail -n 0 -f ./logs/DEPLOY.log | grep -q "Finished setting up the Neurobagel graph backend."; do + : + done + echo "Finished setting up the Neurobagel graph backend." + + - name: Run end to end tests + uses: cypress-io/github-action@v6 + with: + wait-on: http://localhost:3000 + component: false + + - name: Latest broke, tell someone + if: ${{ failure() }} + run: | + curl -X POST -H 'Content-type: application/json' --data '{"text":"Neurobagel nightly is incompatible!"}' ${{ secrets.NB_SLACK_WEBHOOK }} + + - name: Clean up again + working-directory: . + run: | + docker compose --profile full_stack down From 96f0060a8155e9518aca242f3e0c25ab024abfc7 Mon Sep 17 00:00:00 2001 From: Sebastian Urchs Date: Wed, 8 May 2024 13:38:08 -0400 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Arman Jahanpour <77515879+rmanaem@users.noreply.github.com> --- .github/workflows/compatibility.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/compatibility.yaml b/.github/workflows/compatibility.yaml index ccc0d19..ae62248 100644 --- a/.github/workflows/compatibility.yaml +++ b/.github/workflows/compatibility.yaml @@ -58,10 +58,10 @@ jobs: run: | docker compose --profile full_stack down - - name: Latest broke, tell someone + - name: Latest failed, tell someone if: ${{ failure() }} run: | - curl -X POST -H 'Content-type: application/json' --data '{"text":"Neurobagel latest broke! Please check https://github.com/neurobagel/recipes/actions and resolve the incompatible versions!"}' ${{ secrets.NB_SLACK_WEBHOOK }} + curl -X POST -H 'Content-type: application/json' --data '{"text":"Neurobagel latest version compatibility test failed! Please check https://github.com/neurobagel/recipes/actions and resolve the incompatible versions!"}' ${{ secrets.NB_SLACK_WEBHOOK }} - name: Clean up again working-directory: . @@ -115,12 +115,12 @@ jobs: wait-on: http://localhost:3000 component: false - - name: Latest broke, tell someone + - name: Nightly failed, tell someone if: ${{ failure() }} run: | - curl -X POST -H 'Content-type: application/json' --data '{"text":"Neurobagel nightly is incompatible!"}' ${{ secrets.NB_SLACK_WEBHOOK }} + curl -X POST -H 'Content-type: application/json' --data '{"text":"Neurobagel nightly version compatibility test failed!"}' ${{ secrets.NB_SLACK_WEBHOOK }} - - name: Clean up again + - name: Clean up working-directory: . run: | docker compose --profile full_stack down From afb897250c40e49b317fb221719a3eb3beaee4ec Mon Sep 17 00:00:00 2001 From: Sebastian Urchs Date: Wed, 8 May 2024 14:00:32 -0400 Subject: [PATCH 4/4] [FIX] Apply fixes from code review --- .github/workflows/compatibility.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/compatibility.yaml b/.github/workflows/compatibility.yaml index ae62248..68a5c34 100644 --- a/.github/workflows/compatibility.yaml +++ b/.github/workflows/compatibility.yaml @@ -18,7 +18,6 @@ jobs: run: | cp template.env .env cp local_nb_nodes.template.json local_nb_nodes.json - sed -i 's/latest/nightly/g' .env - name: Run docker compose working-directory: . @@ -53,11 +52,6 @@ jobs: wait-on: http://localhost:3000 component: false - - name: Clean up again - working-directory: . - run: | - docker compose --profile full_stack down - - name: Latest failed, tell someone if: ${{ failure() }} run: |