-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Set up
compatibility test
workflow (#35)
* Set up Cypress and added a e2e test * Added `Tech stack compatibility` workflow * Fixed the issue with the workflow config file * Wait on query tool * Added `wait on query tool` step * Update .env file * Added `wait on graph set up` step * Updated workflow config file * Renamed test * Addressed comments from PR
- Loading branch information
Showing
8 changed files
with
2,083 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
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: ./dev | ||
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: ./dev | ||
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: ./dev | ||
run: | | ||
while ! tail -n 0 -f ./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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const { defineConfig } = require("cypress"); | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
experimentalStudio: true, | ||
setupNodeEvents(on, config) { | ||
// implement node event listeners here | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
describe('Full stack e2e', () => { | ||
it('Query tool', () => { | ||
cy.visit('http://localhost:3000/') | ||
cy.get('[data-cy="Neurobagel graph-categorical-field"]').type( | ||
'local graph 1{downarrow}{enter}' | ||
); | ||
cy.get('[data-cy="submit-query-button"]').click(); | ||
cy.get('[data-cy="result-container"]').contains("from Local graph 1",{matchCase: false}); | ||
}) | ||
it('API', () => { | ||
cy.request("localhost:8000/query/").as("query"); | ||
cy.get("@query").should((response) => { | ||
expect(response.status).to.eq(200); | ||
}); | ||
}); | ||
it("Federation API", () => { | ||
cy.request("localhost:8000/query/?node=local graph 1").as("query"); | ||
cy.get("@query").should((response) => { | ||
expect(response.status).to.eq(200); | ||
}); | ||
}) | ||
it("CLI", () => { | ||
cy.exec("docker run --rm neurobagel/bagelcli --help").its("stdout").should("contain", "Usage: bagel"); | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// *********************************************** | ||
// This example commands.js shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add('login', (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// *********************************************************** | ||
// This example support/e2e.js is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands' | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') |
Oops, something went wrong.