mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-18 21:27:51 +00:00
v12 preparations: Amend test cases for '--nogitignore' option
Connects-to: #1770 Change-type: patch
This commit is contained in:
parent
040c4987fc
commit
2fc0728a09
@ -22,6 +22,7 @@ import { expect } from 'chai';
|
||||
import { fs } from 'mz';
|
||||
import * as path from 'path';
|
||||
|
||||
import { isV12 } from '../../build/utils/version';
|
||||
import { BalenaAPIMock } from '../balena-api-mock';
|
||||
import { BuilderMock, builderResponsePath } from '../builder-mock';
|
||||
import { expectStreamNoCRLF, testPushBuildStream } from '../docker-build';
|
||||
@ -230,14 +231,23 @@ describe('balena push', function() {
|
||||
'.balena/balena.yml': { fileSize: 12, type: 'file' },
|
||||
'.dockerignore': { fileSize: 438, type: 'file' },
|
||||
'.gitignore': { fileSize: 20, type: 'file' },
|
||||
'.git/bar.txt': { fileSize: 4, type: 'file' },
|
||||
'.git/foo.txt': { fileSize: 4, type: 'file' },
|
||||
'c.txt': { fileSize: 1, type: 'file' },
|
||||
Dockerfile: { fileSize: 13, type: 'file' },
|
||||
'src/.balena/balena.yml': { fileSize: 16, type: 'file' },
|
||||
'src/.gitignore': { fileSize: 10, type: 'file' },
|
||||
'vendor/.git/vendor-git-contents': { fileSize: 20, type: 'file' },
|
||||
...(isV12()
|
||||
? {
|
||||
'a.txt': { fileSize: 1, type: 'file' },
|
||||
'src/src-a.txt': { fileSize: 5, type: 'file' },
|
||||
'src/src-c.txt': { fileSize: 5, type: 'file' },
|
||||
}
|
||||
: {
|
||||
'.git/bar.txt': { fileSize: 4, type: 'file' },
|
||||
}),
|
||||
};
|
||||
|
||||
const regSecretsPath = await addRegSecretsEntries(expectedFiles);
|
||||
const responseFilename = 'build-POST-v3.json';
|
||||
const responseBody = await fs.readFile(
|
||||
@ -245,6 +255,8 @@ describe('balena push', function() {
|
||||
'utf8',
|
||||
);
|
||||
const expectedResponseLines = [
|
||||
...(!isV12()
|
||||
? [
|
||||
'[Warn] Using file ignore patterns from:',
|
||||
`[Warn] ${path.join(projectPath, '.dockerignore')}`,
|
||||
`[Warn] ${path.join(projectPath, '.gitignore')}`,
|
||||
@ -253,6 +265,8 @@ describe('balena push', function() {
|
||||
'[Warn] version release will disregard gitignore files and use a dockerignore file only.',
|
||||
'[Warn] Use the --nogitignore (-G) option to enable the new behavior already now and',
|
||||
"[Warn] suppress this warning. For more information, see 'balena help push'.",
|
||||
]
|
||||
: []),
|
||||
...commonResponseLines[responseFilename],
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user