Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: enable numeric integration tests on emulator #1358

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
84 changes: 25 additions & 59 deletions system-test/spanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,59 +179,31 @@ describe('Spanner', () => {
}

before(done => {
if (IS_EMULATOR_ENABLED) {
// Table without NUMERIC types since the emulator doesn't yet support
// this type.
DATABASE.updateSchema(
`
CREATE TABLE ${TABLE_NAME} (
Key STRING(MAX) NOT NULL,
BytesValue BYTES(MAX),
BoolValue BOOL,
DateValue DATE,
FloatValue FLOAT64,
IntValue INT64,
StringValue STRING(MAX),
TimestampValue TIMESTAMP,
BytesArray ARRAY<BYTES(MAX)>,
BoolArray ARRAY<BOOL>,
DateArray ARRAY<DATE>,
FloatArray ARRAY<FLOAT64>,
IntArray ARRAY<INT64>,
StringArray ARRAY<STRING(MAX)>,
TimestampArray ARRAY<TIMESTAMP>,
CommitTimestamp TIMESTAMP OPTIONS (allow_commit_timestamp=true)
) PRIMARY KEY (Key)
`,
execAfterOperationComplete(done)
);
} else {
DATABASE.updateSchema(
`
CREATE TABLE ${TABLE_NAME} (
Key STRING(MAX) NOT NULL,
BytesValue BYTES(MAX),
BoolValue BOOL,
DateValue DATE,
FloatValue FLOAT64,
IntValue INT64,
NumericValue NUMERIC,
StringValue STRING(MAX),
TimestampValue TIMESTAMP,
BytesArray ARRAY<BYTES(MAX)>,
BoolArray ARRAY<BOOL>,
DateArray ARRAY<DATE>,
FloatArray ARRAY<FLOAT64>,
IntArray ARRAY<INT64>,
NumericArray ARRAY<NUMERIC>,
StringArray ARRAY<STRING(MAX)>,
TimestampArray ARRAY<TIMESTAMP>,
CommitTimestamp TIMESTAMP OPTIONS (allow_commit_timestamp=true)
) PRIMARY KEY (Key)
`,
execAfterOperationComplete(done)
);
}
DATABASE.updateSchema(
`
CREATE TABLE ${TABLE_NAME} (
Key STRING(MAX) NOT NULL,
BytesValue BYTES(MAX),
BoolValue BOOL,
DateValue DATE,
FloatValue FLOAT64,
IntValue INT64,
NumericValue NUMERIC,
StringValue STRING(MAX),
TimestampValue TIMESTAMP,
BytesArray ARRAY<BYTES(MAX)>,
BoolArray ARRAY<BOOL>,
DateArray ARRAY<DATE>,
FloatArray ARRAY<FLOAT64>,
IntArray ARRAY<INT64>,
NumericArray ARRAY<NUMERIC>,
StringArray ARRAY<STRING(MAX)>,
TimestampArray ARRAY<TIMESTAMP>,
CommitTimestamp TIMESTAMP OPTIONS (allow_commit_timestamp=true)
) PRIMARY KEY (Key)
`,
execAfterOperationComplete(done)
);
});

describe('uneven rows', () => {
Expand Down Expand Up @@ -558,12 +530,6 @@ describe('Spanner', () => {
});

describe('numerics', () => {
before(async function () {
if (IS_EMULATOR_ENABLED) {
this.skip();
}
});

it('should write numeric values', done => {
const value = Spanner.numeric('3.141592653');

Expand Down