Skip to content

Commit

Permalink
disable tests altogether for gql less than 15
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Nov 11, 2022
1 parent e41ec3a commit 0908780
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@ import { createServer, Server } from 'http'
import { AddressInfo } from 'net'
import { fetch } from '@whatwg-node/fetch'
import type { GatewayConfig } from '@apollo/gateway'
import { versionInfo as gqlVersion } from 'graphql'

describe('apollo-federation example integration', () => {
if (gqlVersion.major < 16) {
it('skips the test', () => {
console.log('skips the test')
})
return
}
let gatewayServer: Server
let serviceServer: Server
let gatewayPort: number
Expand Down
18 changes: 18 additions & 0 deletions scripts/override-graphql-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,21 @@ pkg.resolutions = {
}

fs.writeFileSync(pkgPath, JSON.stringify(pkg, undefined, ' ') + '\n')

// disable apollo federation testing with <16 versions
const graphql15AndLess = parseInt(graphqlVersion.split('.')[0]) <= 15
;[`examples/apollo-federation`].forEach((testPath) => {
if (graphql15AndLess) {
// disable
fs.renameSync(
path.resolve(__dirname, '..', testPath, '__integration-tests__'),
path.resolve(__dirname, '..', testPath, '__DISABLED_integration-tests__'),
)
} else {
// enable if disabled
fs.renameSync(
path.resolve(__dirname, '..', testPath, '__DISABLED_integration-tests__'),
path.resolve(__dirname, '..', testPath, '__integration-tests__'),
)
}
})

0 comments on commit 0908780

Please sign in to comment.